CMS 3D CMS Logo

List of all members | Public Member Functions | Private Member Functions | Private Attributes
TkAlCaRecoMonitor Class Reference

#include <TkAlCaRecoMonitor.h>

Inheritance diagram for TkAlCaRecoMonitor:
DQMEDAnalyzer edm::stream::EDProducer< edm::GlobalCache< DQMEDAnalyzerGlobalCache >, edm::EndRunProducer, edm::EndLuminosityBlockProducer, edm::Accumulator >

Public Member Functions

void analyze (const edm::Event &, const edm::EventSetup &) override
 
void bookHistograms (DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
 
 TkAlCaRecoMonitor (const edm::ParameterSet &)
 
 ~TkAlCaRecoMonitor () override=default
 
- Public Member Functions inherited from DQMEDAnalyzer
void accumulate (edm::Event const &event, edm::EventSetup const &setup) final
 
void beginLuminosityBlock (edm::LuminosityBlock const &lumi, edm::EventSetup const &setup) final
 
void beginRun (edm::Run const &run, edm::EventSetup const &setup) final
 
void beginStream (edm::StreamID id) final
 
virtual void dqmBeginRun (edm::Run const &, edm::EventSetup const &)
 
 DQMEDAnalyzer ()
 
void endLuminosityBlock (edm::LuminosityBlock const &lumi, edm::EventSetup const &setup) final
 
void endRun (edm::Run const &run, edm::EventSetup const &setup) final
 
virtual bool getCanSaveByLumi ()
 
- Public Member Functions inherited from edm::stream::EDProducer< edm::GlobalCache< DQMEDAnalyzerGlobalCache >, edm::EndRunProducer, edm::EndLuminosityBlockProducer, edm::Accumulator >
 EDProducer ()=default
 
 EDProducer (const EDProducer &)=delete
 
bool hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginProcessBlocks () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndProcessBlocks () const final
 
bool hasAbilityToProduceInEndRuns () const final
 
const EDProduceroperator= (const EDProducer &)=delete
 

Private Member Functions

void fillHitmaps (const reco::Track &track, const TrackerGeometry &geometry)
 
void fillRawIdMap (const TrackerGeometry &geometry)
 

Private Attributes

MonitorElementAlCaRecoTrackEfficiency_
 
std::map< int, int > binByRawId_
 
edm::ParameterSet conf_
 
double daughterMass_
 
bool fillInvariantMass_
 
bool fillRawIdMap_
 
MonitorElementHits_perDetId_
 
MonitorElementHits_XvsY_
 
MonitorElementHits_ZvsR_
 
MonitorElementinvariantMass_
 
edm::EDGetTokenT< reco::CaloJetCollectionjetCollection_
 
MonitorElementjetPt_
 
double maxJetPt_
 
const edm::ESGetToken< MagneticField, IdealMagneticFieldRecordmfToken_
 
MonitorElementminJetDeltaR_
 
MonitorElementminTrackDeltaR_
 
edm::EDGetTokenT< reco::TrackCollectionreferenceTrackProducer_
 
bool runsOnReco_
 
MonitorElementsumCharge_
 
const edm::ESGetToken< TrackerGeometry, TrackerDigiGeometryRecordtkGeomToken_
 
MonitorElementTrackCurvature_
 
edm::EDGetTokenT< reco::TrackCollectiontrackProducer_
 
MonitorElementTrackPtNegative_
 
MonitorElementTrackPtPositive_
 
MonitorElementTrackQuality_
 
bool useSignedR_
 

Additional Inherited Members

- Public Types inherited from DQMEDAnalyzer
typedef dqm::reco::DQMStore DQMStore
 
typedef dqm::reco::MonitorElement MonitorElement
 
- Public Types inherited from edm::stream::EDProducer< edm::GlobalCache< DQMEDAnalyzerGlobalCache >, edm::EndRunProducer, edm::EndLuminosityBlockProducer, edm::Accumulator >
using CacheTypes = CacheContexts< T... >
 
using GlobalCache = typename CacheTypes::GlobalCache
 
using HasAbility = AbilityChecker< T... >
 
using InputProcessBlockCache = typename CacheTypes::InputProcessBlockCache
 
using LuminosityBlockCache = typename CacheTypes::LuminosityBlockCache
 
using LuminosityBlockContext = LuminosityBlockContextT< LuminosityBlockCache, RunCache, GlobalCache >
 
using LuminosityBlockSummaryCache = typename CacheTypes::LuminosityBlockSummaryCache
 
using RunCache = typename CacheTypes::RunCache
 
using RunContext = RunContextT< RunCache, GlobalCache >
 
using RunSummaryCache = typename CacheTypes::RunSummaryCache
 
- Static Public Member Functions inherited from DQMEDAnalyzer
static void globalEndJob (DQMEDAnalyzerGlobalCache const *)
 
static void globalEndLuminosityBlockProduce (edm::LuminosityBlock &lumi, edm::EventSetup const &setup, LuminosityBlockContext const *context)
 
static void globalEndRunProduce (edm::Run &run, edm::EventSetup const &setup, RunContext const *context)
 
static std::unique_ptr< DQMEDAnalyzerGlobalCacheinitializeGlobalCache (edm::ParameterSet const &)
 
- Protected Member Functions inherited from DQMEDAnalyzer
uint64_t meId () const
 
- Protected Attributes inherited from DQMEDAnalyzer
edm::EDPutTokenT< DQMTokenlumiToken_
 
edm::EDPutTokenT< DQMTokenrunToken_
 
unsigned int streamId_
 

Detailed Description

DQM/TrackerMonitorTrack/src/TkAlCaRecoMonitor.cc Monitoring special quantities related to Tracker Alignment AlCaReco Production.

Definition at line 34 of file TkAlCaRecoMonitor.h.

Constructor & Destructor Documentation

◆ TkAlCaRecoMonitor()

TkAlCaRecoMonitor::TkAlCaRecoMonitor ( const edm::ParameterSet iConfig)
explicit

Definition at line 19 of file TkAlCaRecoMonitor.cc.

References conf_, edm::ParameterSet::getParameter(), jetCollection_, referenceTrackProducer_, and trackProducer_.

21  conf_ = iConfig;
22  trackProducer_ = consumes<reco::TrackCollection>(conf_.getParameter<edm::InputTag>("TrackProducer"));
24  consumes<reco::TrackCollection>(conf_.getParameter<edm::InputTag>("ReferenceTrackProducer"));
25  jetCollection_ = mayConsume<reco::CaloJetCollection>(conf_.getParameter<edm::InputTag>("CaloJetCollection"));
26 }
ESGetTokenH3DDVariant esConsumes(std::string const &Record, edm::ConsumesCollector &)
Definition: DeDxTools.cc:283
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
edm::EDGetTokenT< reco::TrackCollection > trackProducer_
const edm::ESGetToken< MagneticField, IdealMagneticFieldRecord > mfToken_
edm::EDGetTokenT< reco::CaloJetCollection > jetCollection_
edm::ParameterSet conf_
edm::EDGetTokenT< reco::TrackCollection > referenceTrackProducer_
const edm::ESGetToken< TrackerGeometry, TrackerDigiGeometryRecord > tkGeomToken_

◆ ~TkAlCaRecoMonitor()

TkAlCaRecoMonitor::~TkAlCaRecoMonitor ( )
overridedefault

Member Function Documentation

◆ analyze()

void TkAlCaRecoMonitor::analyze ( const edm::Event iEvent,
const edm::EventSetup iSetup 
)
overridevirtual

Reimplemented from DQMEDAnalyzer.

Definition at line 185 of file TkAlCaRecoMonitor.cc.

References AlCaRecoTrackEfficiency_, B, binByRawId_, daughterMass_, PbPb_ZMuSkimMuonDPG_cff::deltaR, HGC3DClusterGenMatchSelector_cfi::dR, MillePedeFileConverter_cfg::e, dqm::impl::MonitorElement::Fill(), fillHitmaps(), fillInvariantMass_, fillRawIdMap(), fillRawIdMap_, edm::EventSetup::getHandle(), mps_fire::i, iEvent, invariantMass_, jetCollection_, jetPt_, PDWG_EXODelayedJetMET_cff::jets, HLT_2022v12_cff::magneticField, maxJetPt_, mfToken_, ALCARECOTkAlMuonIsolated_cff::minJetDeltaR, minJetDeltaR_, minTrackDeltaR_, reco::TrackBase::qualitySize, referenceTrackProducer_, runsOnReco_, mathSSE::sqrt(), sumCharge_, tkGeomToken_, HLT_2022v12_cff::track, duplicaterechits_cfi::trackCollection, TrackCurvature_, trackProducer_, TrackPtNegative_, TrackPtPositive_, and TrackQuality_.

185  {
188  if (!trackCollection.isValid()) {
189  edm::LogError("Alignment") << "invalid trackcollection encountered!";
190  return;
191  }
192 
193  edm::Handle<reco::TrackCollection> referenceTrackCollection;
194  iEvent.getByToken(referenceTrackProducer_, referenceTrackCollection);
195  if (!trackCollection.isValid()) {
196  edm::LogError("Alignment") << "invalid reference track-collection encountered!";
197  return;
198  }
199 
200  const auto &geometry = iSetup.getHandle(tkGeomToken_);
201  if (!geometry.isValid()) {
202  edm::LogError("Alignment") << "invalid geometry found in event setup!";
203  }
204 
205  const auto &magneticField = iSetup.getHandle(mfToken_);
206  if (!magneticField.isValid()) {
207  edm::LogError("Alignment") << "invalid magnetic field configuration encountered!";
208  return;
209  }
210 
212  if (runsOnReco_) {
213  iEvent.getByToken(jetCollection_, jets);
214  if (!jets.isValid()) {
215  edm::LogError("Alignment") << "no jet collection found in event!";
216  }
217  }
218  // fill only once - not yet in beginJob since no access to geometry
219  if (fillRawIdMap_ && binByRawId_.empty())
220  this->fillRawIdMap(*geometry);
221 
222  AlCaRecoTrackEfficiency_->Fill(static_cast<double>((*trackCollection).size()) / (*referenceTrackCollection).size());
223 
224  double sumOfCharges = 0;
225  for (reco::TrackCollection::const_iterator track = (*trackCollection).begin(); track < (*trackCollection).end();
226  ++track) {
227  double dR = 0;
228  if (runsOnReco_) {
229  double minJetDeltaR = 10; // some number > 2pi
230  for (reco::CaloJetCollection::const_iterator itJet = jets->begin(); itJet != jets->end(); ++itJet) {
231  jetPt_->Fill((*itJet).pt());
232  dR = deltaR((*track), (*itJet));
233  if ((*itJet).pt() > maxJetPt_ && dR < minJetDeltaR)
234  minJetDeltaR = dR;
235 
236  // edm::LogInfo("Alignment") <<"> isolated: "<< isolated << " jetPt "<<
237  // (*itJet).pt() <<" deltaR: "<< deltaR(*(*it),(*itJet)) ;
238  }
240  }
241 
242  double minTrackDeltaR = 10; // some number > 2pi
243  for (reco::TrackCollection::const_iterator track2 = (*trackCollection).begin(); track2 < (*trackCollection).end();
244  ++track2) {
245  dR = deltaR((*track), (*track2));
246  if (dR < minTrackDeltaR && dR > 1e-6)
247  minTrackDeltaR = dR;
248  }
249 
250  for (int i = 0; i < reco::TrackBase::qualitySize; ++i) {
251  if ((*track).quality(reco::TrackBase::TrackQuality(i))) {
252  TrackQuality_->Fill(i);
253  }
254  }
255 
256  GlobalPoint gPoint((*track).vx(), (*track).vy(), (*track).vz());
257  double B = magneticField->inTesla(gPoint).z();
258  double curv = -(*track).charge() * 0.002998 * B / (*track).pt();
259  TrackCurvature_->Fill(curv);
260 
261  if ((*track).charge() > 0)
262  TrackPtPositive_->Fill((*track).pt());
263  if ((*track).charge() < 0)
264  TrackPtNegative_->Fill((*track).pt());
265 
266  minTrackDeltaR_->Fill(minTrackDeltaR);
268  sumOfCharges += (*track).charge();
269  }
270 
271  sumCharge_->Fill(sumOfCharges);
272 
273  if (fillInvariantMass_) {
274  if ((*trackCollection).size() == 2) {
275  TLorentzVector track0(
276  (*trackCollection).at(0).px(),
277  (*trackCollection).at(0).py(),
278  (*trackCollection).at(0).pz(),
279  sqrt(((*trackCollection).at(0).p() * (*trackCollection).at(0).p()) + daughterMass_ * daughterMass_));
280  TLorentzVector track1(
281  (*trackCollection).at(1).px(),
282  (*trackCollection).at(1).py(),
283  (*trackCollection).at(1).pz(),
284  sqrt(((*trackCollection).at(1).p() * (*trackCollection).at(1).p()) + daughterMass_ * daughterMass_));
285  TLorentzVector mother = track0 + track1;
286 
287  invariantMass_->Fill(mother.M());
288  } else {
289  edm::LogInfo("Alignment") << "wrong number of tracks trackcollection encountered: " << (*trackCollection).size();
290  }
291  }
292 }
std::map< int, int > binByRawId_
Definition: APVGainStruct.h:7
void fillRawIdMap(const TrackerGeometry &geometry)
TrackQuality
track quality
Definition: TrackBase.h:150
MonitorElement * TrackQuality_
MonitorElement * minJetDeltaR_
Log< level::Error, false > LogError
void Fill(long long x)
MonitorElement * AlCaRecoTrackEfficiency_
MonitorElement * sumCharge_
int iEvent
Definition: GenABIO.cc:224
edm::EDGetTokenT< reco::TrackCollection > trackProducer_
const edm::ESGetToken< MagneticField, IdealMagneticFieldRecord > mfToken_
T sqrt(T t)
Definition: SSEVec.h:19
MonitorElement * invariantMass_
MonitorElement * TrackPtNegative_
void fillHitmaps(const reco::Track &track, const TrackerGeometry &geometry)
edm::EDGetTokenT< reco::CaloJetCollection > jetCollection_
ESHandle< T > getHandle(const ESGetToken< T, R > &iToken) const
Definition: EventSetup.h:151
Log< level::Info, false > LogInfo
MonitorElement * TrackCurvature_
MonitorElement * jetPt_
MonitorElement * minTrackDeltaR_
edm::EDGetTokenT< reco::TrackCollection > referenceTrackProducer_
MonitorElement * TrackPtPositive_
const edm::ESGetToken< TrackerGeometry, TrackerDigiGeometryRecord > tkGeomToken_

◆ bookHistograms()

void TkAlCaRecoMonitor::bookHistograms ( DQMStore::IBooker iBooker,
edm::Run const &  ,
edm::EventSetup const &   
)
overridevirtual

Implements DQMEDAnalyzer.

Definition at line 28 of file TkAlCaRecoMonitor.cc.

References AlCaRecoTrackEfficiency_, HLTSiStripMonitoring_cff::AlgoName, dqm::implementation::IBooker::book1D(), dqm::implementation::IBooker::book2D(), conf_, daughterMass_, fillInvariantMass_, fillRawIdMap_, edm::ParameterSet::getParameter(), dqm::impl::MonitorElement::getTH1(), Hits_perDetId_, Hits_XvsY_, Hits_ZvsR_, mps_fire::i, invariantMass_, jetPt_, TkAlCaRecoMonitor_cfi::JetPtBin, TkAlCaRecoMonitor_cfi::JetPtMax, TkAlCaRecoMonitor_cfi::JetPtMin, ALCARECOTkAlDQM_cff::MassBin, ALCARECOTkAlDQM_cff::MassMax, ALCARECOTkAlDQM_cff::MassMin, maxJetPt_, minJetDeltaR_, TkAlCaRecoMonitor_cfi::MinJetDeltaRBin, TkAlCaRecoMonitor_cfi::MinJetDeltaRMax, TkAlCaRecoMonitor_cfi::MinJetDeltaRMin, minTrackDeltaR_, TkAlCaRecoMonitor_cfi::MinTrackDeltaRBin, TkAlCaRecoMonitor_cfi::MinTrackDeltaRMax, TkAlCaRecoMonitor_cfi::MinTrackDeltaRMin, reco::TrackBase::qualityName(), reco::TrackBase::qualitySize, photonAnalyzer_cfi::rBin, referenceTrackProducer_, photonAnalyzer_cfi::rMax, photonAnalyzer_cfi::rMin, runsOnReco_, dqm::impl::MonitorElement::setAxisTitle(), dqm::implementation::NavigatorBase::setCurrentFolder(), AlCaHLTBitMon_QueryRunRegistry::string, sumCharge_, ALCARECOTkAlDQM_cff::SumChargeBin, ALCARECOTkAlDQM_cff::SumChargeMax, ALCARECOTkAlDQM_cff::SumChargeMin, TrackCurvature_, TkAlCaRecoMonitor_cfi::TrackCurvatureBin, TkAlCaRecoMonitor_cfi::TrackCurvatureMax, TkAlCaRecoMonitor_cfi::TrackCurvatureMin, TkAlCaRecoMonitor_cfi::TrackEfficiencyBin, TkAlCaRecoMonitor_cfi::TrackEfficiencyMax, TkAlCaRecoMonitor_cfi::TrackEfficiencyMin, trackProducer_, TrackPtNegative_, TrackPtPositive_, TrackQuality_, useSignedR_, photonAnalyzer_cfi::zBin, and photonAnalyzer_cfi::zMax.

28  {
29  std::string histname; // for naming the histograms according to algorithm used
30 
32  std::string MEFolderName = conf_.getParameter<std::string>("FolderName");
33 
34  daughterMass_ = conf_.getParameter<double>("daughterMass");
35 
36  maxJetPt_ = conf_.getParameter<double>("maxJetPt");
37 
38  iBooker.setCurrentFolder(MEFolderName + "/TkAlignmentSpecific");
39  fillInvariantMass_ = conf_.getParameter<bool>("fillInvariantMass");
40  runsOnReco_ = conf_.getParameter<bool>("runsOnReco");
41  useSignedR_ = conf_.getParameter<bool>("useSignedR");
42  fillRawIdMap_ = conf_.getParameter<bool>("fillRawIdMap");
43 
44  //
45  unsigned int MassBin = conf_.getParameter<unsigned int>("MassBin");
46  double MassMin = conf_.getParameter<double>("MassMin");
47  double MassMax = conf_.getParameter<double>("MassMax");
48 
49  if (fillInvariantMass_) {
50  histname = "InvariantMass_";
51  invariantMass_ = iBooker.book1D(histname + AlgoName, histname + AlgoName, MassBin, MassMin, MassMax);
52  invariantMass_->setAxisTitle("invariant Mass / GeV");
53  } else {
54  invariantMass_ = nullptr;
55  }
56 
57  unsigned int TrackPtPositiveBin = conf_.getParameter<unsigned int>("TrackPtBin");
58  double TrackPtPositiveMin = conf_.getParameter<double>("TrackPtMin");
59  double TrackPtPositiveMax = conf_.getParameter<double>("TrackPtMax");
60 
61  histname = "TrackPtPositive_";
62  TrackPtPositive_ = iBooker.book1D(
63  histname + AlgoName, histname + AlgoName, TrackPtPositiveBin, TrackPtPositiveMin, TrackPtPositiveMax);
64  TrackPtPositive_->setAxisTitle("p_{T} of tracks charge > 0");
65 
66  unsigned int TrackPtNegativeBin = conf_.getParameter<unsigned int>("TrackPtBin");
67  double TrackPtNegativeMin = conf_.getParameter<double>("TrackPtMin");
68  double TrackPtNegativeMax = conf_.getParameter<double>("TrackPtMax");
69 
70  histname = "TrackPtNegative_";
71  TrackPtNegative_ = iBooker.book1D(
72  histname + AlgoName, histname + AlgoName, TrackPtNegativeBin, TrackPtNegativeMin, TrackPtNegativeMax);
73  TrackPtNegative_->setAxisTitle("p_{T} of tracks charge < 0");
74 
75  histname = "TrackQuality_";
76  TrackQuality_ = iBooker.book1D(
77  histname + AlgoName, histname + AlgoName, reco::TrackBase::qualitySize, -0.5, reco::TrackBase::qualitySize - 0.5);
78  TrackQuality_->setAxisTitle("quality");
79  for (int i = 0; i < reco::TrackBase::qualitySize; ++i) {
80  TrackQuality_->getTH1()->GetXaxis()->SetBinLabel(
82  }
83 
84  unsigned int SumChargeBin = conf_.getParameter<unsigned int>("SumChargeBin");
85  double SumChargeMin = conf_.getParameter<double>("SumChargeMin");
86  double SumChargeMax = conf_.getParameter<double>("SumChargeMax");
87 
88  histname = "SumCharge_";
89  sumCharge_ = iBooker.book1D(histname + AlgoName, histname + AlgoName, SumChargeBin, SumChargeMin, SumChargeMax);
90  sumCharge_->setAxisTitle("#SigmaCharge");
91 
92  unsigned int TrackCurvatureBin = conf_.getParameter<unsigned int>("TrackCurvatureBin");
93  double TrackCurvatureMin = conf_.getParameter<double>("TrackCurvatureMin");
94  double TrackCurvatureMax = conf_.getParameter<double>("TrackCurvatureMax");
95 
96  histname = "TrackCurvature_";
99  TrackCurvature_->setAxisTitle("#kappa track");
100 
101  if (runsOnReco_) {
102  unsigned int JetPtBin = conf_.getParameter<unsigned int>("JetPtBin");
103  double JetPtMin = conf_.getParameter<double>("JetPtMin");
104  double JetPtMax = conf_.getParameter<double>("JetPtMax");
105 
106  histname = "JetPt_";
107  jetPt_ = iBooker.book1D(histname + AlgoName, histname + AlgoName, JetPtBin, JetPtMin, JetPtMax);
108  jetPt_->setAxisTitle("jet p_{T} / GeV");
109 
110  unsigned int MinJetDeltaRBin = conf_.getParameter<unsigned int>("MinJetDeltaRBin");
111  double MinJetDeltaRMin = conf_.getParameter<double>("MinJetDeltaRMin");
112  double MinJetDeltaRMax = conf_.getParameter<double>("MinJetDeltaRMax");
113 
114  histname = "MinJetDeltaR_";
115  minJetDeltaR_ =
116  iBooker.book1D(histname + AlgoName, histname + AlgoName, MinJetDeltaRBin, MinJetDeltaRMin, MinJetDeltaRMax);
117  minJetDeltaR_->setAxisTitle("minimal Jet #DeltaR / rad");
118  } else {
119  jetPt_ = nullptr;
120  minJetDeltaR_ = nullptr;
121  }
122 
123  unsigned int MinTrackDeltaRBin = conf_.getParameter<unsigned int>("MinTrackDeltaRBin");
124  double MinTrackDeltaRMin = conf_.getParameter<double>("MinTrackDeltaRMin");
125  double MinTrackDeltaRMax = conf_.getParameter<double>("MinTrackDeltaRMax");
126 
127  histname = "MinTrackDeltaR_";
130  minTrackDeltaR_->setAxisTitle("minimal Track #DeltaR / rad");
131 
132  unsigned int TrackEfficiencyBin = conf_.getParameter<unsigned int>("TrackEfficiencyBin");
133  double TrackEfficiencyMin = conf_.getParameter<double>("TrackEfficiencyMin");
134  double TrackEfficiencyMax = conf_.getParameter<double>("TrackEfficiencyMax");
135 
136  histname = "AlCaRecoTrackEfficiency_";
139  Labels l_tp, l_rtp;
140  labelsForToken(referenceTrackProducer_, l_rtp);
141  labelsForToken(trackProducer_, l_tp);
142  AlCaRecoTrackEfficiency_->setAxisTitle("n(" + std::string(l_tp.module) + ") / n(" + std::string(l_rtp.module) + ")");
143 
144  int zBin = conf_.getParameter<unsigned int>("HitMapsZBin"); // 300
145  double zMax = conf_.getParameter<double>("HitMapZMax"); // 300.0; //cm
146 
147  int rBin = conf_.getParameter<unsigned int>("HitMapsRBin"); // 120;
148  double rMax = conf_.getParameter<double>("HitMapRMax"); // 120.0; //cm
149 
150  histname = "Hits_ZvsR_";
151  double rMin = 0.0;
152  if (useSignedR_)
153  rMin = -rMax;
154 
155  Hits_ZvsR_ = iBooker.book2D(histname + AlgoName, histname + AlgoName, zBin, -zMax, zMax, rBin, rMin, rMax);
156 
157  histname = "Hits_XvsY_";
158  Hits_XvsY_ = iBooker.book2D(histname + AlgoName, histname + AlgoName, rBin, -rMax, rMax, rBin, -rMax, rMax);
159 
160  if (fillRawIdMap_) {
161  histname = "Hits_perDetId_";
162 
163  // leads to differences in axsis between samples??
164  // int nModules = binByRawId_.size();
165  // Hits_perDetId_ = iBooker.book1D(histname+AlgoName, histname+AlgoName,
166  // nModules, static_cast<double>(nModules) -0.5,
167  // static_cast<double>(nModules) -0.5);
168  Hits_perDetId_ = iBooker.book1D(histname + AlgoName, histname + AlgoName, 16601, -0.5, 16600.5);
169  Hits_perDetId_->setAxisTitle("rawId Bins");
170 
172  // std::stringstream binLabel;
173  // for( std::map<int,int>::iterator it = binByRawId_.begin(); it !=
174  // binByRawId_.end(); ++it ){
175  // binLabel.str() = "";
176  // binLabel << (*it).first;
177  // Hits_perDetId_->getTH1()->GetXaxis()->SetBinLabel( (*it).second +1,
178  // binLabel.str().c_str());
179  // }
180  }
181 }
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
static std::string qualityName(TrackQuality)
Definition: TrackBase.h:572
virtual void setCurrentFolder(std::string const &fullpath)
Definition: DQMStore.cc:32
TrackQuality
track quality
Definition: TrackBase.h:150
MonitorElement * TrackQuality_
MonitorElement * minJetDeltaR_
MonitorElement * Hits_XvsY_
MonitorElement * Hits_ZvsR_
MonitorElement * AlCaRecoTrackEfficiency_
MonitorElement * sumCharge_
edm::EDGetTokenT< reco::TrackCollection > trackProducer_
MonitorElement * invariantMass_
MonitorElement * TrackPtNegative_
MonitorElement * Hits_perDetId_
MonitorElement * TrackCurvature_
MonitorElement * book2D(TString const &name, TString const &title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, FUNC onbooking=NOOP())
Definition: DQMStore.h:212
MonitorElement * jetPt_
edm::ParameterSet conf_
MonitorElement * minTrackDeltaR_
MonitorElement * book1D(TString const &name, TString const &title, int const nchX, double const lowX, double const highX, FUNC onbooking=NOOP())
Definition: DQMStore.h:98
edm::EDGetTokenT< reco::TrackCollection > referenceTrackProducer_
MonitorElement * TrackPtPositive_
virtual void setAxisTitle(const std::string &title, int axis=1)
set x-, y- or z-axis title (axis=1, 2, 3 respectively)

◆ fillHitmaps()

void TkAlCaRecoMonitor::fillHitmaps ( const reco::Track track,
const TrackerGeometry geometry 
)
private

Definition at line 294 of file TkAlCaRecoMonitor.cc.

References binByRawId_, dqm::impl::MonitorElement::Fill(), fillRawIdMap_, Hits_perDetId_, Hits_XvsY_, Hits_ZvsR_, alignCSCRings::r, mathSSE::sqrt(), HLT_2022v12_cff::track, and useSignedR_.

Referenced by analyze().

294  {
295  for (trackingRecHit_iterator iHit = track.recHitsBegin(); iHit != track.recHitsEnd(); ++iHit) {
296  if ((*iHit)->isValid()) {
297  const TrackingRecHit *hit = (*iHit);
298  const DetId geoId(hit->geographicalId());
299  const GeomDet *gd = geometry.idToDet(geoId);
300  // since 2_1_X local hit positions are transient. taking center of the hit
301  // module for now. The alternative would be the coarse estimation or a
302  // refit.
303  // const GlobalPoint globP( gd->toGlobal( hit->localPosition() ) );
304  const GlobalPoint globP(gd->toGlobal(Local3DPoint(0., 0., 0.)));
305  double r = sqrt(globP.x() * globP.x() + globP.y() * globP.y());
306  if (useSignedR_)
307  r *= globP.y() / fabs(globP.y());
308 
309  Hits_ZvsR_->Fill(globP.z(), r);
310  Hits_XvsY_->Fill(globP.x(), globP.y());
311 
312  if (fillRawIdMap_)
313  Hits_perDetId_->Fill(binByRawId_[geoId.rawId()]);
314  }
315  }
316 }
std::map< int, int > binByRawId_
MonitorElement * Hits_XvsY_
MonitorElement * Hits_ZvsR_
void Fill(long long x)
T sqrt(T t)
Definition: SSEVec.h:19
Definition: DetId.h:17
MonitorElement * Hits_perDetId_

◆ fillRawIdMap()

void TkAlCaRecoMonitor::fillRawIdMap ( const TrackerGeometry geometry)
private

Definition at line 318 of file TkAlCaRecoMonitor.cc.

References binByRawId_, mps_fire::i, and jetUpdater_cfi::sort.

Referenced by analyze().

318  {
319  std::vector<int> sortedRawIds;
320  for (std::vector<DetId>::const_iterator iDetId = geometry.detUnitIds().begin(); iDetId != geometry.detUnitIds().end();
321  ++iDetId) {
322  sortedRawIds.push_back((*iDetId).rawId());
323  }
324  std::sort(sortedRawIds.begin(), sortedRawIds.end());
325 
326  int i = 0;
327  for (std::vector<int>::iterator iRawId = sortedRawIds.begin(); iRawId != sortedRawIds.end(); ++iRawId) {
328  binByRawId_[*iRawId] = i;
329  ++i;
330  }
331 }
std::map< int, int > binByRawId_

Member Data Documentation

◆ AlCaRecoTrackEfficiency_

MonitorElement* TkAlCaRecoMonitor::AlCaRecoTrackEfficiency_
private

Definition at line 61 of file TkAlCaRecoMonitor.h.

Referenced by analyze(), and bookHistograms().

◆ binByRawId_

std::map<int, int> TkAlCaRecoMonitor::binByRawId_
private

Definition at line 79 of file TkAlCaRecoMonitor.h.

Referenced by analyze(), fillHitmaps(), and fillRawIdMap().

◆ conf_

edm::ParameterSet TkAlCaRecoMonitor::conf_
private

Definition at line 50 of file TkAlCaRecoMonitor.h.

Referenced by bookHistograms(), and TkAlCaRecoMonitor().

◆ daughterMass_

double TkAlCaRecoMonitor::daughterMass_
private

Definition at line 78 of file TkAlCaRecoMonitor.h.

Referenced by analyze(), and bookHistograms().

◆ fillInvariantMass_

bool TkAlCaRecoMonitor::fillInvariantMass_
private

Definition at line 70 of file TkAlCaRecoMonitor.h.

Referenced by analyze(), and bookHistograms().

◆ fillRawIdMap_

bool TkAlCaRecoMonitor::fillRawIdMap_
private

Definition at line 71 of file TkAlCaRecoMonitor.h.

Referenced by analyze(), bookHistograms(), and fillHitmaps().

◆ Hits_perDetId_

MonitorElement* TkAlCaRecoMonitor::Hits_perDetId_
private

Definition at line 62 of file TkAlCaRecoMonitor.h.

Referenced by bookHistograms(), and fillHitmaps().

◆ Hits_XvsY_

MonitorElement* TkAlCaRecoMonitor::Hits_XvsY_
private

Definition at line 68 of file TkAlCaRecoMonitor.h.

Referenced by bookHistograms(), and fillHitmaps().

◆ Hits_ZvsR_

MonitorElement* TkAlCaRecoMonitor::Hits_ZvsR_
private

Definition at line 67 of file TkAlCaRecoMonitor.h.

Referenced by bookHistograms(), and fillHitmaps().

◆ invariantMass_

MonitorElement* TkAlCaRecoMonitor::invariantMass_
private

Definition at line 55 of file TkAlCaRecoMonitor.h.

Referenced by analyze(), and bookHistograms().

◆ jetCollection_

edm::EDGetTokenT<reco::CaloJetCollection> TkAlCaRecoMonitor::jetCollection_
private

Definition at line 77 of file TkAlCaRecoMonitor.h.

Referenced by analyze(), and TkAlCaRecoMonitor().

◆ jetPt_

MonitorElement* TkAlCaRecoMonitor::jetPt_
private

Definition at line 58 of file TkAlCaRecoMonitor.h.

Referenced by analyze(), and bookHistograms().

◆ maxJetPt_

double TkAlCaRecoMonitor::maxJetPt_
private

Definition at line 52 of file TkAlCaRecoMonitor.h.

Referenced by analyze(), and bookHistograms().

◆ mfToken_

const edm::ESGetToken<MagneticField, IdealMagneticFieldRecord> TkAlCaRecoMonitor::mfToken_
private

Definition at line 48 of file TkAlCaRecoMonitor.h.

Referenced by analyze().

◆ minJetDeltaR_

MonitorElement* TkAlCaRecoMonitor::minJetDeltaR_
private

Definition at line 59 of file TkAlCaRecoMonitor.h.

Referenced by analyze(), and bookHistograms().

◆ minTrackDeltaR_

MonitorElement* TkAlCaRecoMonitor::minTrackDeltaR_
private

Definition at line 60 of file TkAlCaRecoMonitor.h.

Referenced by analyze(), and bookHistograms().

◆ referenceTrackProducer_

edm::EDGetTokenT<reco::TrackCollection> TkAlCaRecoMonitor::referenceTrackProducer_
private

Definition at line 76 of file TkAlCaRecoMonitor.h.

Referenced by analyze(), bookHistograms(), and TkAlCaRecoMonitor().

◆ runsOnReco_

bool TkAlCaRecoMonitor::runsOnReco_
private

Definition at line 72 of file TkAlCaRecoMonitor.h.

Referenced by analyze(), and bookHistograms().

◆ sumCharge_

MonitorElement* TkAlCaRecoMonitor::sumCharge_
private

Definition at line 56 of file TkAlCaRecoMonitor.h.

Referenced by analyze(), and bookHistograms().

◆ tkGeomToken_

const edm::ESGetToken<TrackerGeometry, TrackerDigiGeometryRecord> TkAlCaRecoMonitor::tkGeomToken_
private

Definition at line 47 of file TkAlCaRecoMonitor.h.

Referenced by analyze().

◆ TrackCurvature_

MonitorElement* TkAlCaRecoMonitor::TrackCurvature_
private

Definition at line 65 of file TkAlCaRecoMonitor.h.

Referenced by analyze(), and bookHistograms().

◆ trackProducer_

edm::EDGetTokenT<reco::TrackCollection> TkAlCaRecoMonitor::trackProducer_
private

Definition at line 75 of file TkAlCaRecoMonitor.h.

Referenced by analyze(), bookHistograms(), and TkAlCaRecoMonitor().

◆ TrackPtNegative_

MonitorElement* TkAlCaRecoMonitor::TrackPtNegative_
private

Definition at line 64 of file TkAlCaRecoMonitor.h.

Referenced by analyze(), and bookHistograms().

◆ TrackPtPositive_

MonitorElement* TkAlCaRecoMonitor::TrackPtPositive_
private

Definition at line 63 of file TkAlCaRecoMonitor.h.

Referenced by analyze(), and bookHistograms().

◆ TrackQuality_

MonitorElement* TkAlCaRecoMonitor::TrackQuality_
private

Definition at line 57 of file TkAlCaRecoMonitor.h.

Referenced by analyze(), and bookHistograms().

◆ useSignedR_

bool TkAlCaRecoMonitor::useSignedR_
private

Definition at line 73 of file TkAlCaRecoMonitor.h.

Referenced by bookHistograms(), and fillHitmaps().