Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 27 additions & 0 deletions CalibTracker/SiStripCommon/plugins/ShallowGainCalibration.cc
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,10 @@ ShallowGainCalibration::ShallowGainCalibration(const edm::ParameterSet& iConfig)
produces <std::vector<double> > ( Prefix + "gainused" + Suffix );
produces <std::vector<double> > ( Prefix + "gainusedTick" + Suffix );
produces <std::vector<float> > ( Prefix + "variance" + Suffix );
// for backplane corrections
produces <std::vector<float> > ( Prefix + "localx" + Suffix );
produces <std::vector<float> > ( Prefix + "rhlocalx" + Suffix );
produces <std::vector<float> > ( Prefix + "rhlocalxerr" + Suffix );
}

void ShallowGainCalibration::
Expand All @@ -55,6 +59,10 @@ produce(edm::Event& iEvent, const edm::EventSetup& iSetup) {
auto gainused = std::make_unique<std::vector<double>> ();
auto gainusedTick = std::make_unique<std::vector<double>> ();
auto variance = std::make_unique<std::vector<float>> ();
// for backplane corrections
auto localx = std::make_unique<std::vector<float>> ();
auto rhlocalx = std::make_unique<std::vector<float>> ();
auto rhlocalxerr = std::make_unique<std::vector<float>> ();

edm::ESHandle<TrackerGeometry> theTrackerGeometry; iSetup.get<TrackerDigiGeometryRecord>().get( theTrackerGeometry );
m_tracker=&(* theTrackerGeometry );
Expand All @@ -76,6 +84,8 @@ produce(edm::Event& iEvent, const edm::EventSetup& iSetup) {
const SiStripRecHit2D* sistripsimplehit = dynamic_cast<const SiStripRecHit2D*>(hit);
const SiStripMatchedRecHit2D* sistripmatchedhit = dynamic_cast<const SiStripMatchedRecHit2D*>(hit);
const SiPixelRecHit* sipixelhit = dynamic_cast<const SiPixelRecHit*>(hit);
// for the backplane corrections
const StripGeomDetUnit* theStripDet = dynamic_cast<const StripGeomDetUnit*>( theTrackerGeometry->idToDet( hit->geographicalId() ) );

const SiPixelCluster* PixelCluster = nullptr;
const SiStripCluster* StripCluster = nullptr;
Expand Down Expand Up @@ -114,6 +124,9 @@ produce(edm::Event& iEvent, const edm::EventSetup& iSetup) {
int FirstStrip = 0;
int NStrips = 0;
float Variance = -1;
float locx = -10;
float rhlocx = -10;
float rhlocxerr = -10;

if(StripCluster){
const auto & Ampls = StripCluster->amplitudes();
Expand Down Expand Up @@ -156,6 +169,10 @@ produce(edm::Event& iEvent, const edm::EventSetup& iSetup) {
const SiStripClusterInfo info(*StripCluster, iSetup, DetId);
Variance = info.variance();

locx = (theStripDet->toLocal(trajState.globalPosition())).x();
rhlocx = hit->localPosition().x();
rhlocxerr = sqrt(hit->localPositionError().xx());

}else if(PixelCluster){
const auto& Ampls = PixelCluster->pixelADC();
int FirstRow = PixelCluster->minPixelRow();
Expand Down Expand Up @@ -192,6 +209,11 @@ produce(edm::Event& iEvent, const edm::EventSetup& iSetup) {
gainused ->push_back( PrevGain );
gainusedTick ->push_back( PrevGainTick );
variance ->push_back( Variance );
// for the backplane corrections
localx->push_back(locx);
rhlocalx->push_back(rhlocx);
rhlocalxerr->push_back(rhlocxerr);

}
}
}
Expand All @@ -215,6 +237,11 @@ produce(edm::Event& iEvent, const edm::EventSetup& iSetup) {
iEvent.put(std::move(gainused), Prefix + "gainused" + Suffix );
iEvent.put(std::move(gainusedTick), Prefix + "gainusedTick" + Suffix );
iEvent.put(std::move(variance), Prefix + "variance" + Suffix );
// for the backplane corrections
iEvent.put(std::move(localx), Prefix + "localx" + Suffix );
iEvent.put(std::move(rhlocalx), Prefix + "rhlocalx" + Suffix );
iEvent.put(std::move(rhlocalxerr), Prefix + "rhlocalxerr" + Suffix );

}

/*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,10 @@
VarParsing.VarParsing.varType.int,
"run number to process (\"-1\" for all)")

options.register('cosmicTriggers','',
VarParsing.VarParsing.multiplicity.list,
VarParsing.VarParsing.varType.string,
'cosmic triggers')



Expand Down Expand Up @@ -154,6 +158,9 @@
)
)

if len(options.cosmicTriggers)>0:
print("cosmicTriggers : ", options.cosmicTriggers)
process.IsolatedMuonFilter.triggerConditions = cms.vstring(options.cosmicTriggers)


process.TkCalPath_StdBunch = cms.Path(process.TkCalSeq_StdBunch *process.shallowEventRun*process.eventInfo)
Expand Down