CMS 3D CMS Logo

List of all members | Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes | Static 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
 

Static Public Member Functions

static void fillDescriptions (edm::ConfigurationDescriptions &)
 
- 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 &)
 

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_
 
const double daughterMass_
 
const bool fillInvariantMass_
 
const bool fillRawIdMap_
 
MonitorElementHits_perDetId_
 
MonitorElementHits_XvsY_
 
MonitorElementHits_ZvsR_
 
MonitorElementinvariantMass_
 
const edm::EDGetTokenT< reco::CaloJetCollectionjetCollection_
 
MonitorElementjetPt_
 
const double maxJetPt_
 
const edm::ESGetToken< MagneticField, IdealMagneticFieldRecordmfToken_
 
MonitorElementminJetDeltaR_
 
MonitorElementminTrackDeltaR_
 
const edm::EDGetTokenT< reco::TrackCollectionreferenceTrackProducer_
 
const bool runsOnReco_
 
MonitorElementsumCharge_
 
const edm::ESGetToken< TrackerGeometry, TrackerDigiGeometryRecordtkGeomToken_
 
MonitorElementTrackCurvature_
 
const edm::EDGetTokenT< reco::TrackCollectiontrackProducer_
 
MonitorElementTrackPtNegative_
 
MonitorElementTrackPtPositive_
 
MonitorElementTrackQuality_
 
const bool useSignedR_
 

Static Private Attributes

static constexpr const double kMuonMass_ = 0.1056583755
 

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
 
- 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_.

22  trackProducer_(consumes<reco::TrackCollection>(iConfig.getParameter<edm::InputTag>("TrackProducer"))),
24  consumes<reco::TrackCollection>(iConfig.getParameter<edm::InputTag>("ReferenceTrackProducer"))),
25  jetCollection_(mayConsume<reco::CaloJetCollection>(iConfig.getParameter<edm::InputTag>("CaloJetCollection"))),
26  daughterMass_(iConfig.getParameter<double>("daughterMass")),
27  maxJetPt_(iConfig.getParameter<double>("maxJetPt")),
28  fillInvariantMass_(iConfig.getParameter<bool>("fillInvariantMass")),
29  fillRawIdMap_(iConfig.getParameter<bool>("fillRawIdMap")),
30  runsOnReco_(iConfig.getParameter<bool>("runsOnReco")),
31  useSignedR_(iConfig.getParameter<bool>("useSignedR")) {
32  // copy configuration object to use it in bookHistograms
33  conf_ = iConfig;
34 }
ESGetTokenH3DDVariant esConsumes(std::string const &Record, edm::ConsumesCollector &)
Definition: DeDxTools.cc:283
T getParameter(std::string const &) const
Definition: ParameterSet.h:307
const bool fillInvariantMass_
const bool fillRawIdMap_
const edm::EDGetTokenT< reco::TrackCollection > trackProducer_
const edm::EDGetTokenT< reco::CaloJetCollection > jetCollection_
const double daughterMass_
const edm::ESGetToken< MagneticField, IdealMagneticFieldRecord > mfToken_
const edm::EDGetTokenT< reco::TrackCollection > referenceTrackProducer_
edm::ParameterSet conf_
const double maxJetPt_
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 188 of file TkAlCaRecoMonitor.cc.

References AlCaRecoTrackEfficiency_, B, binByRawId_, daughterMass_, HLTMuonOfflineAnalyzer_cfi::deltaR2, ALPAKA_ACCELERATOR_NAMESPACE::dR2(), 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_2024v13_cff::magneticField, maxJetPt_, mfToken_, minJetDeltaR_, minTrackDeltaR_, reco::TrackBase::qualitySize, referenceTrackProducer_, runsOnReco_, mathSSE::sqrt(), sumCharge_, tkGeomToken_, HLT_2024v13_cff::track, JetHT_cfg::trackCollection, TrackCurvature_, trackProducer_, TrackPtNegative_, TrackPtPositive_, and TrackQuality_.

190 {
193  if (!trackCollection.isValid()) {
194  edm::LogError("Alignment") << "invalid trackcollection encountered!";
195  return;
196  }
197 
198  edm::Handle<reco::TrackCollection> referenceTrackCollection;
199  iEvent.getByToken(referenceTrackProducer_, referenceTrackCollection);
200  if (!trackCollection.isValid()) {
201  edm::LogError("Alignment") << "invalid reference track-collection encountered!";
202  return;
203  }
204 
205  const auto &geometry = iSetup.getHandle(tkGeomToken_);
206  if (!geometry.isValid()) {
207  edm::LogError("Alignment") << "invalid geometry found in event setup!";
208  }
209 
210  const auto &magneticField = iSetup.getHandle(mfToken_);
211  if (!magneticField.isValid()) {
212  edm::LogError("Alignment") << "invalid magnetic field configuration encountered!";
213  return;
214  }
215 
217  if (runsOnReco_) {
218  iEvent.getByToken(jetCollection_, jets);
219  if (!jets.isValid()) {
220  edm::LogError("Alignment") << "no jet collection found in event!";
221  }
222  }
223  // fill only once - not yet in beginJob since no access to geometry
224  if (fillRawIdMap_ && binByRawId_.empty())
225  this->fillRawIdMap(*geometry);
226 
227  AlCaRecoTrackEfficiency_->Fill(static_cast<double>((*trackCollection).size()) / (*referenceTrackCollection).size());
228 
229  double sumOfCharges = 0;
230  for (const auto &track : *trackCollection) {
231  double dR2 = 0;
232  if (runsOnReco_) {
233  double minJetDeltaR2 = 10 * 10; // some number > 2pi
234  for (const auto &itJet : *jets) {
235  jetPt_->Fill(itJet.pt());
236  dR2 = deltaR2(track, itJet);
237  if (itJet.pt() > maxJetPt_ && dR2 < minJetDeltaR2)
238  minJetDeltaR2 = dR2;
239 
240  // edm::LogInfo("Alignment") <<"> isolated: "<< isolated << " jetPt "<<
241  // (*itJet).pt() <<" deltaR: "<< deltaR(*(*it),(*itJet)) ;
242  }
243  minJetDeltaR_->Fill(std::sqrt(minJetDeltaR2));
244  }
245 
246  double minTrackDeltaR2 = 10 * 10; // some number > 2pi
247  for (const auto &track2 : *trackCollection) {
248  dR2 = deltaR2(track, track2);
249  if (dR2 < minTrackDeltaR2 && dR2 > 1e-12)
250  minTrackDeltaR2 = dR2;
251  }
252 
253  for (int i = 0; i < reco::TrackBase::qualitySize; ++i) {
254  if (track.quality(reco::TrackBase::TrackQuality(i))) {
255  TrackQuality_->Fill(i);
256  }
257  }
258 
259  GlobalPoint gPoint(track.vx(), track.vy(), track.vz());
260  double B = magneticField->inTesla(gPoint).z();
261  double curv = -track.charge() * 0.002998 * B / track.pt();
262  TrackCurvature_->Fill(curv);
263 
264  track.charge() > 0 ? TrackPtPositive_->Fill(track.pt()) : TrackPtNegative_->Fill(track.pt());
265 
266  minTrackDeltaR_->Fill(std::sqrt(minTrackDeltaR2));
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
const bool fillInvariantMass_
void fillRawIdMap(const TrackerGeometry &geometry)
TrackQuality
track quality
Definition: TrackBase.h:150
MonitorElement * TrackQuality_
const bool fillRawIdMap_
MonitorElement * minJetDeltaR_
Log< level::Error, false > LogError
const edm::EDGetTokenT< reco::TrackCollection > trackProducer_
const edm::EDGetTokenT< reco::CaloJetCollection > jetCollection_
void Fill(long long x)
MonitorElement * AlCaRecoTrackEfficiency_
const double daughterMass_
MonitorElement * sumCharge_
int iEvent
Definition: GenABIO.cc:224
ALPAKA_FN_ACC static ALPAKA_FN_INLINE float dR2(Position4 pos1, Position4 pos2)
const edm::ESGetToken< MagneticField, IdealMagneticFieldRecord > mfToken_
T sqrt(T t)
Definition: SSEVec.h:23
MonitorElement * invariantMass_
MonitorElement * TrackPtNegative_
void fillHitmaps(const reco::Track &track, const TrackerGeometry &geometry)
trackCollection
Definition: JetHT_cfg.py:51
ESHandle< T > getHandle(const ESGetToken< T, R > &iToken) const
Definition: EventSetup.h:130
const edm::EDGetTokenT< reco::TrackCollection > referenceTrackProducer_
Log< level::Info, false > LogInfo
MonitorElement * TrackCurvature_
MonitorElement * jetPt_
MonitorElement * minTrackDeltaR_
MonitorElement * TrackPtPositive_
const double maxJetPt_
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 36 of file TkAlCaRecoMonitor.cc.

References AlCaRecoTrackEfficiency_, HLTSiStripMonitoring_cff::AlgoName, dqm::implementation::IBooker::book1D(), dqm::implementation::IBooker::book2D(), conf_, 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, 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.

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

◆ fillDescriptions()

void TkAlCaRecoMonitor::fillDescriptions ( edm::ConfigurationDescriptions descriptions)
static

Definition at line 338 of file TkAlCaRecoMonitor.cc.

References edm::ConfigurationDescriptions::addWithDefaultLabel(), submitPVResolutionJobs::desc, ProducerED_cfi::InputTag, kMuonMass_, and AlCaHLTBitMon_QueryRunRegistry::string.

340 {
342  desc.setComment("Generic track analyzer to check ALCARECO Tracker Alignment specific sample quantities");
343  desc.add<edm::InputTag>("TrackProducer", edm::InputTag("generalTracks"));
344  desc.add<edm::InputTag>("ReferenceTrackProducer", edm::InputTag("generalTrakcs"));
345  desc.add<edm::InputTag>("CaloJetCollection", edm::InputTag("ak4CaloJets"));
346  desc.add<std::string>("AlgoName", "testTkAlCaReco");
347  desc.add<std::string>("FolderName", "TkAlCaRecoMonitor");
348  desc.add<double>("daughterMass", kMuonMass_)->setComment("GeV");
349  desc.add<double>("maxJetPt", 10.)->setComment("GeV");
350  desc.add<bool>("fillInvariantMass", false);
351  desc.add<bool>("runsOnReco", false);
352  desc.add<bool>("useSignedR", false);
353  desc.add<bool>("fillRawIdMap", false);
354  desc.add<unsigned int>("MassBin", 100);
355  desc.add<double>("MassMin", 0.0);
356  desc.add<double>("MassMax", 100.0);
357  desc.add<unsigned int>("TrackPtBin", 110);
358  desc.add<double>("TrackPtMin", 0.0);
359  desc.add<double>("TrackPtMax", 110.);
360  desc.add<unsigned int>("TrackCurvatureBin", 2000);
361  desc.add<double>("TrackCurvatureMin", -0.01)->setComment("1/GeV");
362  desc.add<double>("TrackCurvatureMax", 0.01)->setComment("1/GeV");
363  desc.add<unsigned int>("SumChargeBin", 11);
364  desc.add<double>("SumChargeMin", -5.5);
365  desc.add<double>("SumChargeMax", 5.5);
366  desc.add<unsigned int>("JetPtBin", 100);
367  desc.add<double>("JetPtMin", 0.0);
368  desc.add<double>("JetPtMax", 50.0);
369  desc.add<unsigned int>("MinJetDeltaRBin", 100);
370  desc.add<double>("MinJetDeltaRMin", 0);
371  desc.add<double>("MinJetDeltaRMax", 10);
372  desc.add<unsigned int>("MinTrackDeltaRBin", 100);
373  desc.add<double>("MinTrackDeltaRMin", 0);
374  desc.add<double>("MinTrackDeltaRMax", 3.2);
375  desc.add<unsigned int>("TrackEfficiencyBin", 102);
376  desc.add<double>("TrackEfficiencyMin", -0.01);
377  desc.add<double>("TrackEfficiencyMax", 1.01);
378  desc.add<unsigned int>("HitMapsZBin", 300);
379  desc.add<double>("HitMapZMax", 300.)->setComment("cm");
380  desc.add<unsigned int>("HitMapsRBin", 120);
381  desc.add<double>("HitMapRMax", 120.)->setComment("cm");
382  descriptions.addWithDefaultLabel(desc);
383 }
void addWithDefaultLabel(ParameterSetDescription const &psetDescription)
static constexpr const double kMuonMass_

◆ fillHitmaps()

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

Definition at line 295 of file TkAlCaRecoMonitor.cc.

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

Referenced by analyze().

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

◆ fillRawIdMap()

void TkAlCaRecoMonitor::fillRawIdMap ( const TrackerGeometry geometry)
private

Definition at line 321 of file TkAlCaRecoMonitor.cc.

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

Referenced by analyze().

323 {
324  std::vector<int> sortedRawIds;
325  for (const auto &iDetId : geometry.detUnitIds()) {
326  sortedRawIds.push_back(iDetId.rawId());
327  }
328  std::sort(sortedRawIds.begin(), sortedRawIds.end());
329 
330  int i = 0;
331  for (const auto &iRawId : sortedRawIds) {
332  binByRawId_[iRawId] = i;
333  ++i;
334  }
335 }
std::map< int, int > binByRawId_

Member Data Documentation

◆ AlCaRecoTrackEfficiency_

MonitorElement* TkAlCaRecoMonitor::AlCaRecoTrackEfficiency_
private

Definition at line 74 of file TkAlCaRecoMonitor.h.

Referenced by analyze(), and bookHistograms().

◆ binByRawId_

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

Definition at line 83 of file TkAlCaRecoMonitor.h.

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

◆ conf_

edm::ParameterSet TkAlCaRecoMonitor::conf_
private

Definition at line 65 of file TkAlCaRecoMonitor.h.

Referenced by bookHistograms(), and TkAlCaRecoMonitor().

◆ daughterMass_

const double TkAlCaRecoMonitor::daughterMass_
private

Definition at line 58 of file TkAlCaRecoMonitor.h.

Referenced by analyze().

◆ fillInvariantMass_

const bool TkAlCaRecoMonitor::fillInvariantMass_
private

Definition at line 60 of file TkAlCaRecoMonitor.h.

Referenced by analyze(), and bookHistograms().

◆ fillRawIdMap_

const bool TkAlCaRecoMonitor::fillRawIdMap_
private

Definition at line 61 of file TkAlCaRecoMonitor.h.

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

◆ Hits_perDetId_

MonitorElement* TkAlCaRecoMonitor::Hits_perDetId_
private

Definition at line 75 of file TkAlCaRecoMonitor.h.

Referenced by bookHistograms(), and fillHitmaps().

◆ Hits_XvsY_

MonitorElement* TkAlCaRecoMonitor::Hits_XvsY_
private

Definition at line 81 of file TkAlCaRecoMonitor.h.

Referenced by bookHistograms(), and fillHitmaps().

◆ Hits_ZvsR_

MonitorElement* TkAlCaRecoMonitor::Hits_ZvsR_
private

Definition at line 80 of file TkAlCaRecoMonitor.h.

Referenced by bookHistograms(), and fillHitmaps().

◆ invariantMass_

MonitorElement* TkAlCaRecoMonitor::invariantMass_
private

Definition at line 68 of file TkAlCaRecoMonitor.h.

Referenced by analyze(), and bookHistograms().

◆ jetCollection_

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

Definition at line 56 of file TkAlCaRecoMonitor.h.

Referenced by analyze().

◆ jetPt_

MonitorElement* TkAlCaRecoMonitor::jetPt_
private

Definition at line 71 of file TkAlCaRecoMonitor.h.

Referenced by analyze(), and bookHistograms().

◆ kMuonMass_

constexpr const double TkAlCaRecoMonitor::kMuonMass_ = 0.1056583755
staticprivate

Definition at line 45 of file TkAlCaRecoMonitor.h.

Referenced by fillDescriptions().

◆ maxJetPt_

const double TkAlCaRecoMonitor::maxJetPt_
private

Definition at line 59 of file TkAlCaRecoMonitor.h.

Referenced by analyze().

◆ mfToken_

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

Definition at line 52 of file TkAlCaRecoMonitor.h.

Referenced by analyze().

◆ minJetDeltaR_

MonitorElement* TkAlCaRecoMonitor::minJetDeltaR_
private

Definition at line 72 of file TkAlCaRecoMonitor.h.

Referenced by analyze(), and bookHistograms().

◆ minTrackDeltaR_

MonitorElement* TkAlCaRecoMonitor::minTrackDeltaR_
private

Definition at line 73 of file TkAlCaRecoMonitor.h.

Referenced by analyze(), and bookHistograms().

◆ referenceTrackProducer_

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

Definition at line 55 of file TkAlCaRecoMonitor.h.

Referenced by analyze(), and bookHistograms().

◆ runsOnReco_

const bool TkAlCaRecoMonitor::runsOnReco_
private

Definition at line 62 of file TkAlCaRecoMonitor.h.

Referenced by analyze(), and bookHistograms().

◆ sumCharge_

MonitorElement* TkAlCaRecoMonitor::sumCharge_
private

Definition at line 69 of file TkAlCaRecoMonitor.h.

Referenced by analyze(), and bookHistograms().

◆ tkGeomToken_

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

Definition at line 51 of file TkAlCaRecoMonitor.h.

Referenced by analyze().

◆ TrackCurvature_

MonitorElement* TkAlCaRecoMonitor::TrackCurvature_
private

Definition at line 78 of file TkAlCaRecoMonitor.h.

Referenced by analyze(), and bookHistograms().

◆ trackProducer_

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

Definition at line 54 of file TkAlCaRecoMonitor.h.

Referenced by analyze(), and bookHistograms().

◆ TrackPtNegative_

MonitorElement* TkAlCaRecoMonitor::TrackPtNegative_
private

Definition at line 77 of file TkAlCaRecoMonitor.h.

Referenced by analyze(), and bookHistograms().

◆ TrackPtPositive_

MonitorElement* TkAlCaRecoMonitor::TrackPtPositive_
private

Definition at line 76 of file TkAlCaRecoMonitor.h.

Referenced by analyze(), and bookHistograms().

◆ TrackQuality_

MonitorElement* TkAlCaRecoMonitor::TrackQuality_
private

Definition at line 70 of file TkAlCaRecoMonitor.h.

Referenced by analyze(), and bookHistograms().

◆ useSignedR_

const bool TkAlCaRecoMonitor::useSignedR_
private

Definition at line 63 of file TkAlCaRecoMonitor.h.

Referenced by bookHistograms(), and fillHitmaps().