diff --git a/CalibTracker/SiStripCommon/plugins/ShallowGainCalibration.cc b/CalibTracker/SiStripCommon/plugins/ShallowGainCalibration.cc index fa1aaeb0a670b..a4952809331ac 100644 --- a/CalibTracker/SiStripCommon/plugins/ShallowGainCalibration.cc +++ b/CalibTracker/SiStripCommon/plugins/ShallowGainCalibration.cc @@ -32,6 +32,10 @@ ShallowGainCalibration::ShallowGainCalibration(const edm::ParameterSet& iConfig) produces > ( Prefix + "gainused" + Suffix ); produces > ( Prefix + "gainusedTick" + Suffix ); produces > ( Prefix + "variance" + Suffix ); +// for backplane corrections + produces > ( Prefix + "localx" + Suffix ); + produces > ( Prefix + "rhlocalx" + Suffix ); + produces > ( Prefix + "rhlocalxerr" + Suffix ); } void ShallowGainCalibration:: @@ -55,6 +59,10 @@ produce(edm::Event& iEvent, const edm::EventSetup& iSetup) { auto gainused = std::make_unique> (); auto gainusedTick = std::make_unique> (); auto variance = std::make_unique> (); +// for backplane corrections + auto localx = std::make_unique> (); + auto rhlocalx = std::make_unique> (); + auto rhlocalxerr = std::make_unique> (); edm::ESHandle theTrackerGeometry; iSetup.get().get( theTrackerGeometry ); m_tracker=&(* theTrackerGeometry ); @@ -76,6 +84,8 @@ produce(edm::Event& iEvent, const edm::EventSetup& iSetup) { const SiStripRecHit2D* sistripsimplehit = dynamic_cast(hit); const SiStripMatchedRecHit2D* sistripmatchedhit = dynamic_cast(hit); const SiPixelRecHit* sipixelhit = dynamic_cast(hit); + // for the backplane corrections + const StripGeomDetUnit* theStripDet = dynamic_cast( theTrackerGeometry->idToDet( hit->geographicalId() ) ); const SiPixelCluster* PixelCluster = nullptr; const SiStripCluster* StripCluster = nullptr; @@ -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(); @@ -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(); @@ -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); + } } } @@ -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 ); + } /* diff --git a/CalibTracker/SiStripCommon/test/MakeCalibrationTrees/produceCalibrationTree_template_cfg.py b/CalibTracker/SiStripCommon/test/MakeCalibrationTrees/produceCalibrationTree_template_cfg.py index 611ff5e1262c6..a0a64a9fa4150 100644 --- a/CalibTracker/SiStripCommon/test/MakeCalibrationTrees/produceCalibrationTree_template_cfg.py +++ b/CalibTracker/SiStripCommon/test/MakeCalibrationTrees/produceCalibrationTree_template_cfg.py @@ -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') @@ -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)