CMS 3D CMS Logo

List of all members | Classes | Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | Private Attributes
TrackToTrackComparisonHists Class Reference

#include <TrackToTrackComparisonHists.h>

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

Classes

struct  generalME
 
struct  matchingME
 

Public Types

typedef std::vector< std::pair< int, std::map< double, int > > > idx2idxByDoubleColl
 
- 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
 

Public Member Functions

 TrackToTrackComparisonHists (const edm::ParameterSet &)
 
 ~TrackToTrackComparisonHists () override
 
- 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 &descriptions)
 
static void fillHistoPSetDescription (edm::ParameterSetDescription &pset)
 
- 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

void analyze (const edm::Event &iEvent, const edm::EventSetup &iSetup) override
 
void beginJob (const edm::EventSetup &iSetup)
 
void book_generic_tracks_histos (DQMStore::IBooker &ibooker, generalME &mes, TString label, std::string &dir)
 
void book_matching_tracks_histos (DQMStore::IBooker &ibooker, matchingME &mes, TString label, std::string &dir)
 
void bookHistograms (DQMStore::IBooker &iBooker, edm::Run const &iRun, edm::EventSetup const &iSetup) override
 
void bookHistos (DQMStore::IBooker &ibooker, generalME &mes, TString label, std::string &dir)
 
void fill_generic_tracks_histos (generalME &mes, reco::Track *trk, reco::BeamSpot *bs, reco::Vertex *pv, unsigned int ls, double onlinelumi, double PU, bool requirePlateau=true)
 
void fill_matching_tracks_histos (matchingME &mes, reco::Track *mon, reco::Track *ref, reco::BeamSpot *bs, reco::Vertex *pv)
 
void fillMap (const edm::View< reco::Track > &tracks1, const edm::View< reco::Track > &tracks2, idx2idxByDoubleColl &map, float dRMin)
 
void initialize_parameter (const edm::ParameterSet &iConfig)
 
- Protected Member Functions inherited from DQMEDAnalyzer
uint64_t meId () const
 

Protected Attributes

DQMStoredqmStore_
 
edm::EDGetTokenT< LumiScalersCollectionlumiScalersToken_
 
edm::EDGetTokenT< reco::BeamSpotmonitoredBSToken_
 
edm::EDGetTokenT< reco::VertexCollectionmonitoredPVToken_
 
edm::InputTag monitoredTrackInputTag_
 
edm::EDGetTokenT< edm::View< reco::Track > > monitoredTrackToken_
 
edm::EDGetTokenT< OnlineLuminosityRecordonlineMetaDataDigisToken_
 
edm::EDGetTokenT< reco::BeamSpotreferenceBSToken_
 
edm::EDGetTokenT< reco::VertexCollectionreferencePVToken_
 
edm::InputTag referenceTrackInputTag_
 
edm::EDGetTokenT< edm::View< reco::Track > > referenceTrackToken_
 
- Protected Attributes inherited from DQMEDAnalyzer
edm::EDPutTokenT< DQMTokenlumiToken_
 
edm::EDPutTokenT< DQMTokenrunToken_
 
unsigned int streamId_
 

Private Attributes

double dRmin_
 
unsigned int Dxy_nbin
 
double Dxy_rangeMax
 
double Dxy_rangeMin
 
double dxyCutForPlateau_
 
unsigned int dxyRes_nbin
 
double dxyRes_rangeMax
 
double dxyRes_rangeMin
 
unsigned int Dz_nbin
 
double Dz_rangeMax
 
double Dz_rangeMin
 
unsigned int dzRes_nbin
 
double dzRes_rangeMax
 
double dzRes_rangeMin
 
double dzWRTPvCut_
 
unsigned int Eta_nbin
 
double Eta_rangeMax
 
double Eta_rangeMin
 
unsigned int etaRes_nbin
 
double etaRes_rangeMax
 
double etaRes_rangeMin
 
std::unique_ptr< GenericTriggerEventFlaggenTriggerEventFlag_
 
bool hltPathsAreValid_ = false
 
unsigned int ls_nbin
 
unsigned int ls_rangeMax
 
unsigned int ls_rangeMin
 
generalME matchedReferenceTracksMEs_
 
matchingME matchTracksMEs_
 
generalME monitoredTracksMEs_
 
unsigned int onlinelumi_nbin
 
double onlinelumi_rangeMax
 
double onlinelumi_rangeMin
 
unsigned int Phi_nbin
 
double Phi_rangeMax
 
double Phi_rangeMin
 
unsigned int phiRes_nbin
 
double phiRes_rangeMax
 
double phiRes_rangeMin
 
unsigned int Pt_nbin
 
double Pt_rangeMax
 
double Pt_rangeMin
 
double pTCutForPlateau_
 
unsigned int ptRes_nbin
 
double ptRes_rangeMax
 
double ptRes_rangeMin
 
unsigned int PU_nbin
 
double PU_rangeMax
 
double PU_rangeMin
 
generalME referenceTracksMEs_
 
bool requireValidHLTPaths_
 
std::string topDirName_
 
generalME unMatchedMonitoredTracksMEs_
 

Detailed Description

Definition at line 39 of file TrackToTrackComparisonHists.h.

Member Typedef Documentation

◆ idx2idxByDoubleColl

typedef std::vector<std::pair<int, std::map<double, int> > > TrackToTrackComparisonHists::idx2idxByDoubleColl

Definition at line 55 of file TrackToTrackComparisonHists.h.

Constructor & Destructor Documentation

◆ TrackToTrackComparisonHists()

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

Definition at line 17 of file TrackToTrackComparisonHists.cc.

References edm::ParameterSet::getParameter(), initialize_parameter(), edm::InputTag::label(), TrackToTrackComparisonHists::generalME::label, TrackToTrackComparisonHists::matchingME::label, lumiScalersToken_, matchedReferenceTracksMEs_, matchTracksMEs_, monitoredBSToken_, monitoredPVToken_, monitoredTrackInputTag_, monitoredTracksMEs_, monitoredTrackToken_, onlineMetaDataDigisToken_, referenceBSToken_, referencePVToken_, referenceTrackInputTag_, referenceTracksMEs_, referenceTrackToken_, and unMatchedMonitoredTracksMEs_.

18  : monitoredTrackInputTag_(iConfig.getParameter<edm::InputTag>("monitoredTrack")),
19  referenceTrackInputTag_(iConfig.getParameter<edm::InputTag>("referenceTrack")),
20  topDirName_(iConfig.getParameter<std::string>("topDirName")),
21  dRmin_(iConfig.getParameter<double>("dRmin")),
22  pTCutForPlateau_(iConfig.getParameter<double>("pTCutForPlateau")),
23  dxyCutForPlateau_(iConfig.getParameter<double>("dxyCutForPlateau")),
24  dzWRTPvCut_(iConfig.getParameter<double>("dzWRTPvCut")),
25  requireValidHLTPaths_(iConfig.getParameter<bool>("requireValidHLTPaths")),
27  iConfig.getParameter<edm::ParameterSet>("genericTriggerEventPSet"), consumesCollector(), *this))
28 
29 {
30  initialize_parameter(iConfig);
31 
32  //now do what ever initialization is needed
33  monitoredTrackToken_ = consumes<edm::View<reco::Track>>(monitoredTrackInputTag_);
34  referenceTrackToken_ = consumes<edm::View<reco::Track>>(referenceTrackInputTag_);
35  monitoredBSToken_ = consumes<reco::BeamSpot>(iConfig.getParameter<edm::InputTag>("monitoredBeamSpot"));
36  referenceBSToken_ = consumes<reco::BeamSpot>(iConfig.getParameter<edm::InputTag>("referenceBeamSpot"));
37  monitoredPVToken_ = consumes<reco::VertexCollection>(iConfig.getParameter<edm::InputTag>("monitoredPrimaryVertices"));
38  referencePVToken_ = consumes<reco::VertexCollection>(iConfig.getParameter<edm::InputTag>("referencePrimaryVertices"));
39  lumiScalersToken_ = consumes<LumiScalersCollection>(iConfig.getParameter<edm::InputTag>("scalers"));
41  consumes<OnlineLuminosityRecord>(iConfig.getParameter<edm::InputTag>("onlineMetaDataDigis"));
42 
45 
48 
49  matchTracksMEs_.label = "matches";
50 }
T getParameter(std::string const &) const
Definition: ParameterSet.h:307
edm::EDGetTokenT< reco::BeamSpot > referenceBSToken_
edm::EDGetTokenT< reco::VertexCollection > monitoredPVToken_
Provides a code based selection for trigger and DCS information in order to have no failing filters i...
std::string const & label() const
Definition: InputTag.h:36
std::unique_ptr< GenericTriggerEventFlag > genTriggerEventFlag_
edm::EDGetTokenT< OnlineLuminosityRecord > onlineMetaDataDigisToken_
edm::EDGetTokenT< LumiScalersCollection > lumiScalersToken_
void initialize_parameter(const edm::ParameterSet &iConfig)
edm::EDGetTokenT< reco::BeamSpot > monitoredBSToken_
edm::EDGetTokenT< reco::VertexCollection > referencePVToken_
edm::EDGetTokenT< edm::View< reco::Track > > referenceTrackToken_
edm::EDGetTokenT< edm::View< reco::Track > > monitoredTrackToken_

◆ ~TrackToTrackComparisonHists()

TrackToTrackComparisonHists::~TrackToTrackComparisonHists ( )
override

Definition at line 52 of file TrackToTrackComparisonHists.cc.

References genTriggerEventFlag_.

52  {
54  genTriggerEventFlag_.reset();
55 }
std::unique_ptr< GenericTriggerEventFlag > genTriggerEventFlag_

Member Function Documentation

◆ analyze()

void TrackToTrackComparisonHists::analyze ( const edm::Event iEvent,
const edm::EventSetup iSetup 
)
overrideprotectedvirtual

Reimplemented from DQMEDAnalyzer.

Definition at line 59 of file TrackToTrackComparisonHists.cc.

References edm::View< T >::at(), HLT_2024v14_cff::dRmin, dRmin_, dzWRTPvCut_, edm::InputTag::encode(), HcalObjRepresent::Fill(), fill_generic_tracks_histos(), fill_matching_tracks_histos(), fillMap(), genTriggerEventFlag_, TrackToTrackComparisonHists::generalME::h_dRmin, TrackToTrackComparisonHists::generalME::h_dRmin_l, hltPathsAreValid_, iEvent, edm::InputTag::instance(), edm::HandleBase::isValid(), edm::InputTag::label(), LogDebug, relval_nano::ls, lumiScalersToken_, muonTagProbeFilters_cff::matched, matchedReferenceTracksMEs_, matchTracksMEs_, monitoredBSToken_, monitoredPVToken_, monitoredTrackInputTag_, monitoredTracksMEs_, monitoredTrackToken_, onlineMetaDataDigisToken_, reco::Vertex::position(), edm::InputTag::process(), relval_steps::PU, referenceBSToken_, referencePVToken_, referenceTrackInputTag_, referenceTracksMEs_, referenceTrackToken_, requireValidHLTPaths_, edm::View< T >::size(), HLT_2024v14_cff::track, and unMatchedMonitoredTracksMEs_.

59  {
60  LogDebug("TrackToTrackComparisonHists")
61  << " requireValidHLTPaths_ " << requireValidHLTPaths_ << " hltPathsAreValid_ " << hltPathsAreValid_ << "\n";
62  // if valid HLT paths are required,
63  // analyze event only if paths are valid
65  return;
66  }
67 
68  LogDebug("TrackToTrackComparisonHists") << " genTriggerEventFlag_->on() " << genTriggerEventFlag_->on()
69  << " accept: " << genTriggerEventFlag_->accept(iEvent, iSetup) << "\n";
70  // Filter out events if Trigger Filtering is requested
71  if (genTriggerEventFlag_->on() && !genTriggerEventFlag_->accept(iEvent, iSetup)) {
72  return;
73  }
74 
75  //
76  // Get Lumi/LS Info
77  //
78 
79  unsigned int ls = iEvent.id().luminosityBlock();
80 
81  double onlinelumi = -1.f;
82  double PU = -1.f;
83 
84  auto const lumiScalersHandle = iEvent.getHandle(lumiScalersToken_);
85  auto const onlineMetaDataDigisHandle = iEvent.getHandle(onlineMetaDataDigisToken_);
86 
87  if (onlineMetaDataDigisHandle.isValid()) {
88  onlinelumi = onlineMetaDataDigisHandle->instLumi();
89  PU = onlineMetaDataDigisHandle->avgPileUp();
90  } else if (lumiScalersHandle.isValid() and not lumiScalersHandle->empty()) {
91  edm::LogError("TrackToTrackComparisonHists") << "onlineMetaDataDigisHandle not found, trying SCAL";
92  auto const scalit = lumiScalersHandle->begin();
93  onlinelumi = scalit->instantLumi();
94  PU = scalit->pileup();
95  } else {
96  edm::LogError("TrackToTrackComparisonHists") << "lumiScalersHandle not found or empty, skipping event";
97  return;
98  }
99 
100  //
101  // Get Reference Track Info
102  //
103  edm::Handle<edm::View<reco::Track>> referenceTracksHandle;
104  iEvent.getByToken(referenceTrackToken_, referenceTracksHandle);
105  if (!referenceTracksHandle.isValid()) {
106  edm::LogError("TrackToTrackComparisonHists")
107  << "referenceTracksHandle with input tag " << referenceTrackInputTag_.encode() << " not found, skipping event";
108  return;
109  }
110  const edm::View<reco::Track>& referenceTracks = *referenceTracksHandle;
111 
112  edm::Handle<reco::BeamSpot> referenceBSHandle;
113  iEvent.getByToken(referenceBSToken_, referenceBSHandle);
114  if (!referenceBSHandle.isValid()) {
115  edm::LogError("TrackToTrackComparisonHists") << "referenceBSHandle not found, skipping event";
116  return;
117  }
118  reco::BeamSpot referenceBS = *referenceBSHandle;
119 
120  edm::Handle<reco::VertexCollection> referencePVHandle;
121  iEvent.getByToken(referencePVToken_, referencePVHandle);
122  if (!referencePVHandle.isValid()) {
123  edm::LogError("TrackToTrackComparisonHists") << "referencePVHandle not found, skipping event";
124  return;
125  }
126  if (referencePVHandle->empty()) {
127  edm::LogInfo("TrackToTrackComparisonHists") << "referencePVHandle->size is 0 ";
128  return;
129  }
130  reco::Vertex referencePV = referencePVHandle->at(0);
131 
132  //
133  // Get Monitored Track Info
134  //
135  edm::Handle<edm::View<reco::Track>> monitoredTracksHandle;
136  iEvent.getByToken(monitoredTrackToken_, monitoredTracksHandle);
137  if (!monitoredTracksHandle.isValid()) {
138  edm::LogError("TrackToTrackComparisonHists")
139  << "monitoredTracksHandle with input tag " << monitoredTrackInputTag_.encode() << " not found, skipping event";
140  return;
141  }
142  const edm::View<reco::Track>& monitoredTracks = *monitoredTracksHandle;
143 
144  edm::Handle<reco::BeamSpot> monitoredBSHandle;
145  iEvent.getByToken(monitoredBSToken_, monitoredBSHandle);
146  if (!monitoredTracksHandle.isValid()) {
147  edm::LogError("TrackToTrackComparisonHists") << "monitoredBSHandle not found, skipping event";
148  return;
149  }
150  reco::BeamSpot monitoredBS = *monitoredBSHandle;
151 
152  edm::Handle<reco::VertexCollection> monitoredPVHandle;
153  iEvent.getByToken(monitoredPVToken_, monitoredPVHandle);
154  if (!monitoredPVHandle.isValid()) {
155  edm::LogError("TrackToTrackComparisonHists") << "monitoredPVHandle not found, skipping event";
156  return;
157  }
158  if (monitoredPVHandle->empty()) {
159  edm::LogInfo("TrackToTrackComparisonHists") << "monitoredPVHandle->size is 0 ";
160  return;
161  }
162  reco::Vertex monitoredPV = monitoredPVHandle->at(0);
163 
164  edm::LogInfo("TrackToTrackComparisonHists")
165  << "analyzing " << monitoredTrackInputTag_.process() << ":" << monitoredTrackInputTag_.label() << ":"
166  << monitoredTrackInputTag_.instance() << " w.r.t. " << referenceTrackInputTag_.process() << ":"
168 
169  //
170  // Build the dR maps
171  //
172  idx2idxByDoubleColl monitored2referenceColl;
173  fillMap(monitoredTracks, referenceTracks, monitored2referenceColl, dRmin_);
174 
175  idx2idxByDoubleColl reference2monitoredColl;
176  fillMap(referenceTracks, monitoredTracks, reference2monitoredColl, dRmin_);
177 
178  unsigned int nReferenceTracks(0); // Counts the number of refernce tracks
179  unsigned int nMatchedReferenceTracks(0); // Counts the number of matched refernce tracks
180  unsigned int nMonitoredTracks(0); // Counts the number of monitored tracks
181  unsigned int nUnmatchedMonitoredTracks(0); // Counts the number of unmatched monitored tracks
182 
183  //
184  // loop over reference tracks
185  //
186  LogDebug("TrackToTrackComparisonHists") << "\n# of tracks (reference): " << referenceTracks.size() << "\n";
187  for (idx2idxByDoubleColl::const_iterator pItr = reference2monitoredColl.begin(), eItr = reference2monitoredColl.end();
188  pItr != eItr;
189  ++pItr) {
190  nReferenceTracks++;
191  int trackIdx = pItr->first;
192  reco::Track track = referenceTracks.at(trackIdx);
193 
194  float dzWRTpv = track.dz(referencePV.position());
195  if (fabs(dzWRTpv) > dzWRTPvCut_)
196  continue;
197 
198  fill_generic_tracks_histos(*&referenceTracksMEs_, &track, &referenceBS, &referencePV, ls, onlinelumi, PU);
199 
200  std::map<double, int> trackDRmap = pItr->second;
201  if (trackDRmap.empty()) {
204  continue;
205  }
206 
207  double dRmin = trackDRmap.begin()->first;
210 
211  bool matched = false;
212  if (dRmin < dRmin_)
213  matched = true;
214 
215  if (matched) {
216  nMatchedReferenceTracks++;
217  fill_generic_tracks_histos(*&matchedReferenceTracksMEs_, &track, &referenceBS, &referencePV, ls, onlinelumi, PU);
220 
221  int matchedTrackIndex = trackDRmap[dRmin];
222  reco::Track matchedTrack = monitoredTracks.at(matchedTrackIndex);
223  fill_matching_tracks_histos(*&matchTracksMEs_, &track, &matchedTrack, &referenceBS, &referencePV);
224  }
225 
226  } // Over reference tracks
227 
228  //
229  // loop over monitoed tracks
230  //
231  LogDebug("TrackToTrackComparisonHists") << "\n# of tracks (monitored): " << monitoredTracks.size() << "\n";
232  for (idx2idxByDoubleColl::const_iterator pItr = monitored2referenceColl.begin(), eItr = monitored2referenceColl.end();
233  pItr != eItr;
234  ++pItr) {
235  nMonitoredTracks++;
236  int trackIdx = pItr->first;
237  reco::Track track = monitoredTracks.at(trackIdx);
238 
239  float dzWRTpv = track.dz(monitoredPV.position());
240  if (fabs(dzWRTpv) > dzWRTPvCut_)
241  continue;
242 
243  fill_generic_tracks_histos(*&monitoredTracksMEs_, &track, &monitoredBS, &monitoredPV, ls, onlinelumi, PU);
244 
245  std::map<double, int> trackDRmap = pItr->second;
246  if (trackDRmap.empty()) {
249  continue;
250  }
251 
252  double dRmin = trackDRmap.begin()->first;
255 
256  bool matched = false;
257  if (dRmin < dRmin_)
258  matched = true;
259 
260  if (!matched) {
261  nUnmatchedMonitoredTracks++;
263  *&unMatchedMonitoredTracksMEs_, &track, &monitoredBS, &monitoredPV, ls, onlinelumi, PU);
266  }
267 
268  } // over monitoed tracks
269 
270  edm::LogInfo("TrackToTrackComparisonHists")
271  << "Total reference tracks: " << nReferenceTracks << "\n"
272  << "Total matched reference tracks: " << nMatchedReferenceTracks << "\n"
273  << "Total monitored tracks: " << nMonitoredTracks << "\n"
274  << "Total unMatched monitored tracks: " << nUnmatchedMonitoredTracks << "\n";
275 }
edm::EDGetTokenT< reco::BeamSpot > referenceBSToken_
edm::EDGetTokenT< reco::VertexCollection > monitoredPVToken_
std::string encode() const
Definition: InputTag.cc:159
std::string const & instance() const
Definition: InputTag.h:37
const Point & position() const
position
Definition: Vertex.h:128
dictionary PU
std::string const & label() const
Definition: InputTag.h:36
Log< level::Error, false > LogError
size_type size() const
int iEvent
Definition: GenABIO.cc:224
std::unique_ptr< GenericTriggerEventFlag > genTriggerEventFlag_
void Fill(HcalDetId &id, double val, std::vector< TH2F > &depth)
edm::EDGetTokenT< OnlineLuminosityRecord > onlineMetaDataDigisToken_
void fillMap(const edm::View< reco::Track > &tracks1, const edm::View< reco::Track > &tracks2, idx2idxByDoubleColl &map, float dRMin)
const_reference at(size_type pos) const
std::vector< std::pair< int, std::map< double, int > > > idx2idxByDoubleColl
void fill_generic_tracks_histos(generalME &mes, reco::Track *trk, reco::BeamSpot *bs, reco::Vertex *pv, unsigned int ls, double onlinelumi, double PU, bool requirePlateau=true)
Log< level::Info, false > LogInfo
edm::EDGetTokenT< LumiScalersCollection > lumiScalersToken_
void fill_matching_tracks_histos(matchingME &mes, reco::Track *mon, reco::Track *ref, reco::BeamSpot *bs, reco::Vertex *pv)
bool isValid() const
Definition: HandleBase.h:70
edm::EDGetTokenT< reco::BeamSpot > monitoredBSToken_
edm::EDGetTokenT< reco::VertexCollection > referencePVToken_
edm::EDGetTokenT< edm::View< reco::Track > > referenceTrackToken_
edm::EDGetTokenT< edm::View< reco::Track > > monitoredTrackToken_
std::string const & process() const
Definition: InputTag.h:40
#define LogDebug(id)

◆ beginJob()

void TrackToTrackComparisonHists::beginJob ( const edm::EventSetup iSetup)
protected

Definition at line 57 of file TrackToTrackComparisonHists.cc.

57 {}

◆ book_generic_tracks_histos()

void TrackToTrackComparisonHists::book_generic_tracks_histos ( DQMStore::IBooker ibooker,
generalME mes,
TString  label,
std::string &  dir 
)
protected

Definition at line 388 of file TrackToTrackComparisonHists.cc.

References dqm::implementation::IBooker::book1D(), dqm::implementation::IBooker::book2D(), dqm::implementation::NavigatorBase::cd(), DeadROC_duringRun::dir, Dxy_nbin, Dxy_rangeMax, Dxy_rangeMin, Dz_nbin, Dz_rangeMax, Dz_rangeMin, Eta_nbin, Eta_rangeMax, Eta_rangeMin, TrackToTrackComparisonHists::generalME::h_charge, TrackToTrackComparisonHists::generalME::h_dRmin, TrackToTrackComparisonHists::generalME::h_dRmin_l, TrackToTrackComparisonHists::generalME::h_dxy, TrackToTrackComparisonHists::generalME::h_dxyWRTpv, TrackToTrackComparisonHists::generalME::h_dz, TrackToTrackComparisonHists::generalME::h_dzWRTpv, TrackToTrackComparisonHists::generalME::h_eta, TrackToTrackComparisonHists::generalME::h_hits, TrackToTrackComparisonHists::generalME::h_ls, TrackToTrackComparisonHists::generalME::h_onlinelumi, TrackToTrackComparisonHists::generalME::h_phi, TrackToTrackComparisonHists::generalME::h_pt, TrackToTrackComparisonHists::generalME::h_pt_vs_eta, TrackToTrackComparisonHists::generalME::h_PU, label, ls_nbin, ls_rangeMax, ls_rangeMin, onlinelumi_nbin, onlinelumi_rangeMax, onlinelumi_rangeMin, Phi_nbin, Phi_rangeMax, Phi_rangeMin, Pt_nbin, Pt_rangeMax, Pt_rangeMin, PU_nbin, PU_rangeMax, PU_rangeMin, and dqm::implementation::NavigatorBase::setCurrentFolder().

Referenced by bookHistos().

391  {
392  ibooker.cd();
393  ibooker.setCurrentFolder(dir);
394  (mes.h_pt) = ibooker.book1D(label + "_pt", "track p_{T}", Pt_nbin, Pt_rangeMin, Pt_rangeMax);
395  (mes.h_eta) = ibooker.book1D(label + "_eta", "track pseudorapidity", Eta_nbin, Eta_rangeMin, Eta_rangeMax);
396  (mes.h_phi) = ibooker.book1D(label + "_phi", "track #phi", Phi_nbin, Phi_rangeMin, Phi_rangeMax);
397  (mes.h_dxy) =
398  ibooker.book1D(label + "_dxy", "track transverse dca to beam spot", Dxy_nbin, Dxy_rangeMin, Dxy_rangeMax);
399  (mes.h_dz) = ibooker.book1D(label + "_dz", "track longitudinal dca to beam spot", Dz_nbin, Dz_rangeMin, Dz_rangeMax);
400  (mes.h_dxyWRTpv) = ibooker.book1D(
401  label + "_dxyWRTpv", "track transverse dca to primary vertex", Dxy_nbin, Dxy_rangeMin, Dxy_rangeMax);
402  (mes.h_dzWRTpv) = ibooker.book1D(
403  label + "_dzWRTpv", "track longitudinal dca to primary vertex", Dz_nbin, 0.1 * Dz_rangeMin, 0.1 * Dz_rangeMax);
404  (mes.h_charge) = ibooker.book1D(label + "_charge", "track charge", 5, -2, 2);
405  (mes.h_hits) = ibooker.book1D(label + "_hits", "track number of hits", 35, -0.5, 34.5);
406  (mes.h_dRmin) = ibooker.book1D(label + "_dRmin", "track min dR", 100, 0., 0.01);
407  (mes.h_dRmin_l) = ibooker.book1D(label + "_dRmin_l", "track min dR", 100, 0., 0.4);
408 
409  (mes.h_pt_vs_eta) = ibooker.book2D(label + "_ptVSeta",
410  "track p_{T} vs #eta",
411  Eta_nbin,
412  Eta_rangeMin,
413  Eta_rangeMax,
414  Pt_nbin,
415  Pt_rangeMin,
416  Pt_rangeMax);
417 
418  // counts of tracks vs lumi
419  // for this moment, xmin,xmax and binning are hardcoded, maybe in future in a config file!
420  // have to add (declare) this in the .h file as well
421  (mes.h_onlinelumi) = ibooker.book1D(label + "_onlinelumi",
422  "number of tracks vs onlinelumi",
426  (mes.h_ls) = ibooker.book1D(label + "_ls", "number of tracks vs ls", ls_nbin, ls_rangeMin, ls_rangeMax);
427  (mes.h_PU) = ibooker.book1D(label + "_PU", "number of tracks vs PU", PU_nbin, PU_rangeMin, PU_rangeMax);
428 }
virtual void setCurrentFolder(std::string const &fullpath)
Definition: DQMStore.cc:36
char const * label
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 * book1D(TString const &name, TString const &title, int const nchX, double const lowX, double const highX, FUNC onbooking=NOOP())
Definition: DQMStore.h:98

◆ book_matching_tracks_histos()

void TrackToTrackComparisonHists::book_matching_tracks_histos ( DQMStore::IBooker ibooker,
matchingME mes,
TString  label,
std::string &  dir 
)
protected

Definition at line 430 of file TrackToTrackComparisonHists.cc.

References dqm::implementation::IBooker::book1D(), dqm::implementation::IBooker::book2D(), dqm::implementation::NavigatorBase::cd(), DeadROC_duringRun::dir, dxyRes_nbin, dxyRes_rangeMax, dxyRes_rangeMin, dzRes_nbin, dzRes_rangeMax, dzRes_rangeMin, Eta_nbin, Eta_rangeMax, Eta_rangeMin, etaRes_nbin, etaRes_rangeMax, etaRes_rangeMin, TrackToTrackComparisonHists::matchingME::h_dCharge, TrackToTrackComparisonHists::matchingME::h_dDxy, TrackToTrackComparisonHists::matchingME::h_dDxyWRTpv, TrackToTrackComparisonHists::matchingME::h_dDz, TrackToTrackComparisonHists::matchingME::h_dDzWRTpv, TrackToTrackComparisonHists::matchingME::h_dEta, TrackToTrackComparisonHists::matchingME::h_dHits, TrackToTrackComparisonHists::matchingME::h_dPhi, TrackToTrackComparisonHists::matchingME::h_dPt, TrackToTrackComparisonHists::matchingME::h_eta_vs_eta, TrackToTrackComparisonHists::matchingME::h_hits_vs_hits, TrackToTrackComparisonHists::matchingME::h_phi_vs_phi, TrackToTrackComparisonHists::matchingME::h_pt_vs_pt, label, Phi_nbin, Phi_rangeMax, Phi_rangeMin, phiRes_nbin, phiRes_rangeMax, phiRes_rangeMin, Pt_nbin, Pt_rangeMax, Pt_rangeMin, ptRes_nbin, ptRes_rangeMax, ptRes_rangeMin, and dqm::implementation::NavigatorBase::setCurrentFolder().

Referenced by bookHistograms().

433  {
434  ibooker.cd();
435  ibooker.setCurrentFolder(dir);
436 
437  (mes.h_hits_vs_hits) = ibooker.book2D(
438  label + "_hits_vs_hits", "monitored track # hits vs reference track # hits", 35, -0.5, 34.5, 35, -0.5, 34.5);
439  (mes.h_pt_vs_pt) = ibooker.book2D(label + "_pt_vs_pt",
440  "monitored track p_{T} vs reference track p_{T}",
441  Pt_nbin,
442  Pt_rangeMin,
443  Pt_rangeMax,
444  Pt_nbin,
445  Pt_rangeMin,
446  Pt_rangeMax);
447  (mes.h_eta_vs_eta) = ibooker.book2D(label + "_eta_vs_eta",
448  "monitored track #eta vs reference track #eta",
449  Eta_nbin,
450  Eta_rangeMin,
451  Eta_rangeMax,
452  Eta_nbin,
453  Eta_rangeMin,
454  Eta_rangeMax);
455  (mes.h_phi_vs_phi) = ibooker.book2D(label + "_phi_vs_phi",
456  "monitored track #phi vs reference track #phi",
457  Phi_nbin,
458  Phi_rangeMin,
459  Phi_rangeMax,
460  Phi_nbin,
461  Phi_rangeMin,
462  Phi_rangeMax);
463 
464  (mes.h_dPt) = ibooker.book1D(label + "_dPt", "#Delta track #P_T", ptRes_nbin, ptRes_rangeMin, ptRes_rangeMax);
465  (mes.h_dEta) = ibooker.book1D(label + "_dEta", "#Delta track #eta", etaRes_nbin, etaRes_rangeMin, etaRes_rangeMax);
466  (mes.h_dPhi) = ibooker.book1D(label + "_dPhi", "#Delta track #phi", phiRes_nbin, phiRes_rangeMin, phiRes_rangeMax);
467  (mes.h_dDxy) = ibooker.book1D(
468  label + "_dDxy", "#Delta track transverse dca to beam spot", dxyRes_nbin, dxyRes_rangeMin, dxyRes_rangeMax);
469  (mes.h_dDz) = ibooker.book1D(
470  label + "_dDz", "#Delta track longitudinal dca to beam spot", dzRes_nbin, dzRes_rangeMin, dzRes_rangeMax);
471  (mes.h_dDxyWRTpv) = ibooker.book1D(label + "_dDxyWRTpv",
472  "#Delta track transverse dca to primary vertex ",
473  dxyRes_nbin,
476  (mes.h_dDzWRTpv) = ibooker.book1D(label + "_dDzWRTpv",
477  "#Delta track longitudinal dca to primary vertex",
478  dzRes_nbin,
481  (mes.h_dCharge) = ibooker.book1D(label + "_dCharge", "#Delta track charge", 5, -2.5, 2.5);
482  (mes.h_dHits) = ibooker.book1D(label + "_dHits", "#Delta track number of hits", 39, -19.5, 19.5);
483 }
virtual void setCurrentFolder(std::string const &fullpath)
Definition: DQMStore.cc:36
char const * label
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 * book1D(TString const &name, TString const &title, int const nchX, double const lowX, double const highX, FUNC onbooking=NOOP())
Definition: DQMStore.h:98

◆ bookHistograms()

void TrackToTrackComparisonHists::bookHistograms ( DQMStore::IBooker iBooker,
edm::Run const &  iRun,
edm::EventSetup const &  iSetup 
)
overrideprotectedvirtual

Implements DQMEDAnalyzer.

Definition at line 277 of file TrackToTrackComparisonHists.cc.

References book_matching_tracks_histos(), bookHistos(), DeadROC_duringRun::dir, genTriggerEventFlag_, hltPathsAreValid_, matchedReferenceTracksMEs_, matchTracksMEs_, monitoredTracksMEs_, referenceTracksMEs_, requireValidHLTPaths_, AlCaHLTBitMon_QueryRunRegistry::string, topDirName_, and unMatchedMonitoredTracksMEs_.

279  {
281  genTriggerEventFlag_->initRun(iRun, iSetup);
282 
283  // check if every HLT path specified has a valid match in the HLT Menu
285  (genTriggerEventFlag_ && genTriggerEventFlag_->on() && genTriggerEventFlag_->allHLTPathsAreValid());
286 
287  // if valid HLT paths are required,
288  // create DQM outputs only if all paths are valid
290  return;
291  }
292 
294 
295  bookHistos(ibooker, referenceTracksMEs_, "ref", dir);
296  bookHistos(ibooker, matchedReferenceTracksMEs_, "ref_matched", dir);
297 
298  bookHistos(ibooker, monitoredTracksMEs_, "mon", dir);
299  bookHistos(ibooker, unMatchedMonitoredTracksMEs_, "mon_unMatched", dir);
300 
301  book_matching_tracks_histos(ibooker, matchTracksMEs_, "matches", dir);
302 }
std::unique_ptr< GenericTriggerEventFlag > genTriggerEventFlag_
void book_matching_tracks_histos(DQMStore::IBooker &ibooker, matchingME &mes, TString label, std::string &dir)
void bookHistos(DQMStore::IBooker &ibooker, generalME &mes, TString label, std::string &dir)

◆ bookHistos()

void TrackToTrackComparisonHists::bookHistos ( DQMStore::IBooker ibooker,
generalME mes,
TString  label,
std::string &  dir 
)
protected

Definition at line 381 of file TrackToTrackComparisonHists.cc.

References book_generic_tracks_histos(), DeadROC_duringRun::dir, and label.

Referenced by bookHistograms().

384  {
385  book_generic_tracks_histos(ibooker, mes, label, dir);
386 }
char const * label
void book_generic_tracks_histos(DQMStore::IBooker &ibooker, generalME &mes, TString label, std::string &dir)

◆ fill_generic_tracks_histos()

void TrackToTrackComparisonHists::fill_generic_tracks_histos ( generalME mes,
reco::Track trk,
reco::BeamSpot bs,
reco::Vertex pv,
unsigned int  ls,
double  onlinelumi,
double  PU,
bool  requirePlateau = true 
)
protected

Definition at line 485 of file TrackToTrackComparisonHists.cc.

References cms::cuda::bs, ALCARECOTkAlJpsiMuMu_cff::charge, PVValHelper::dxy, dxyCutForPlateau_, PVValHelper::dz, PVValHelper::eta, HcalObjRepresent::Fill(), TrackToTrackComparisonHists::generalME::h_charge, TrackToTrackComparisonHists::generalME::h_dxy, TrackToTrackComparisonHists::generalME::h_dxyWRTpv, TrackToTrackComparisonHists::generalME::h_dz, TrackToTrackComparisonHists::generalME::h_dzWRTpv, TrackToTrackComparisonHists::generalME::h_eta, TrackToTrackComparisonHists::generalME::h_hits, TrackToTrackComparisonHists::generalME::h_ls, TrackToTrackComparisonHists::generalME::h_onlinelumi, TrackToTrackComparisonHists::generalME::h_phi, TrackToTrackComparisonHists::generalME::h_pt, TrackToTrackComparisonHists::generalME::h_pt_vs_eta, TrackToTrackComparisonHists::generalME::h_PU, relval_nano::ls, TrackingDataMCValidation_Standalone_cff::nhits, phi, DiDispStaMuonMonitor_cfi::pt, pTCutForPlateau_, relval_steps::PU, and trk.

Referenced by analyze().

492  {
493  float pt = trk->pt();
494  float eta = trk->eta();
495  float phi = trk->phi();
496  float dxy = trk->dxy(bs->position());
497  float dz = trk->dz(bs->position());
498  float dxyWRTpv = trk->dxy(pv->position());
499  float dzWRTpv = trk->dz(pv->position());
500  float charge = trk->charge();
501  float nhits = trk->hitPattern().numberOfValidHits();
502 
503  bool dxyOnPlateau = (fabs(dxyWRTpv) < dxyCutForPlateau_);
504  bool pTOnPlateau = (pt > pTCutForPlateau_);
505 
506  if (dxyOnPlateau || !requirePlateau) {
507  (mes.h_pt)->Fill(pt);
508  }
509 
510  if ((pTOnPlateau && dxyOnPlateau) || !requirePlateau) {
511  (mes.h_eta)->Fill(eta);
512  (mes.h_phi)->Fill(phi);
513  (mes.h_dz)->Fill(dz);
514  (mes.h_dzWRTpv)->Fill(dzWRTpv);
515  (mes.h_charge)->Fill(charge);
516  (mes.h_hits)->Fill(nhits);
517  (mes.h_onlinelumi)->Fill(onlinelumi);
518  (mes.h_ls)->Fill(ls);
519  (mes.h_PU)->Fill(PU);
520  }
521 
522  if (pTOnPlateau || !requirePlateau) {
523  (mes.h_dxy)->Fill(dxy);
524  (mes.h_dxyWRTpv)->Fill(dxyWRTpv);
525  }
526 
527  (mes.h_pt_vs_eta)->Fill(eta, pt);
528 }
Trktree trk
Definition: Trktree.cc:2
dictionary PU
void Fill(HcalDetId &id, double val, std::vector< TH2F > &depth)

◆ fill_matching_tracks_histos()

void TrackToTrackComparisonHists::fill_matching_tracks_histos ( matchingME mes,
reco::Track mon,
reco::Track ref,
reco::BeamSpot bs,
reco::Vertex pv 
)
protected

Definition at line 530 of file TrackToTrackComparisonHists.cc.

References cms::cuda::bs, reco::TrackBase::charge(), reco::TrackBase::dxy(), reco::TrackBase::dz(), reco::TrackBase::eta(), HcalObjRepresent::Fill(), TrackToTrackComparisonHists::matchingME::h_dCharge, TrackToTrackComparisonHists::matchingME::h_dDxy, TrackToTrackComparisonHists::matchingME::h_dDxyWRTpv, TrackToTrackComparisonHists::matchingME::h_dDz, TrackToTrackComparisonHists::matchingME::h_dDzWRTpv, TrackToTrackComparisonHists::matchingME::h_dEta, TrackToTrackComparisonHists::matchingME::h_dHits, TrackToTrackComparisonHists::matchingME::h_dPhi, TrackToTrackComparisonHists::matchingME::h_dPt, TrackToTrackComparisonHists::matchingME::h_eta_vs_eta, TrackToTrackComparisonHists::matchingME::h_hits_vs_hits, TrackToTrackComparisonHists::matchingME::h_phi_vs_phi, TrackToTrackComparisonHists::matchingME::h_pt_vs_pt, reco::TrackBase::hitPattern(), LaserDQM_cfi::mon, reco::HitPattern::numberOfValidHits(), reco::TrackBase::phi(), and reco::TrackBase::pt().

Referenced by analyze().

531  {
532  float mon_pt = mon->pt();
533  float mon_eta = mon->eta();
534  float mon_phi = mon->phi();
535  float mon_dxy = mon->dxy(bs->position());
536  float mon_dz = mon->dz(bs->position());
537  float mon_dxyWRTpv = mon->dxy(pv->position());
538  float mon_dzWRTpv = mon->dz(pv->position());
539  float mon_charge = mon->charge();
540  float mon_nhits = mon->hitPattern().numberOfValidHits();
541 
542  float ref_pt = ref->pt();
543  float ref_eta = ref->eta();
544  float ref_phi = ref->phi();
545  float ref_dxy = ref->dxy(bs->position());
546  float ref_dz = ref->dz(bs->position());
547  float ref_dxyWRTpv = ref->dxy(pv->position());
548  float ref_dzWRTpv = ref->dz(pv->position());
549  float ref_charge = ref->charge();
550  float ref_nhits = ref->hitPattern().numberOfValidHits();
551 
552  (mes.h_hits_vs_hits)->Fill(ref_nhits, mon_nhits);
553  (mes.h_pt_vs_pt)->Fill(ref_pt, mon_pt);
554  (mes.h_eta_vs_eta)->Fill(ref_eta, mon_eta);
555  (mes.h_phi_vs_phi)->Fill(ref_phi, mon_phi);
556 
557  (mes.h_dPt)->Fill(ref_pt - mon_pt);
558  (mes.h_dEta)->Fill(ref_eta - mon_eta);
559  (mes.h_dPhi)->Fill(ref_phi - mon_phi);
560  (mes.h_dDxy)->Fill(ref_dxy - mon_dxy);
561  (mes.h_dDz)->Fill(ref_dz - mon_dz);
562  (mes.h_dDxyWRTpv)->Fill(ref_dxyWRTpv - mon_dxyWRTpv);
563  (mes.h_dDzWRTpv)->Fill(ref_dzWRTpv - mon_dzWRTpv);
564  (mes.h_dCharge)->Fill(ref_charge - mon_charge);
565  (mes.h_dHits)->Fill(ref_nhits - mon_nhits);
566 }
int numberOfValidHits() const
Definition: HitPattern.h:817
double pt() const
track transverse momentum
Definition: TrackBase.h:637
int charge() const
track electric charge
Definition: TrackBase.h:596
double dz() const
dz parameter (= dsz/cos(lambda)). This is the track z0 w.r.t (0,0,0) only if the refPoint is close to...
Definition: TrackBase.h:622
void Fill(HcalDetId &id, double val, std::vector< TH2F > &depth)
double phi() const
azimuthal angle of momentum vector
Definition: TrackBase.h:649
double eta() const
pseudorapidity of momentum vector
Definition: TrackBase.h:652
const HitPattern & hitPattern() const
Access the hit pattern, indicating in which Tracker layers the track has hits.
Definition: TrackBase.h:504
double dxy() const
dxy parameter. (This is the transverse impact parameter w.r.t. to (0,0,0) ONLY if refPoint is close t...
Definition: TrackBase.h:608

◆ fillDescriptions()

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

Definition at line 305 of file TrackToTrackComparisonHists.cc.

References edm::ConfigurationDescriptions::add(), submitPVResolutionJobs::desc, fillHistoPSetDescription(), GenericTriggerEventFlag::fillPSetDescription(), SiStripSourceConfigTier0_cff::genericTriggerEventPSet, V0Monitor_cff::histoPSet, ProducerED_cfi::InputTag, and AlCaHLTBitMon_QueryRunRegistry::string.

305  {
307 
308  desc.add<bool>("requireValidHLTPaths", true);
309 
310  desc.add<edm::InputTag>("monitoredTrack", edm::InputTag("hltMergedTracks"));
311  desc.add<edm::InputTag>("monitoredBeamSpot", edm::InputTag("hltOnlineBeamSpot"));
312  desc.add<edm::InputTag>("monitoredPrimaryVertices", edm::InputTag("hltVerticesPFSelector"));
313 
314  desc.add<edm::InputTag>("referenceTrack", edm::InputTag("generalTracks"));
315  desc.add<edm::InputTag>("referenceBeamSpot", edm::InputTag("offlineBeamSpot"));
316  desc.add<edm::InputTag>("referencePrimaryVertices", edm::InputTag("offlinePrimaryVertices"));
317  desc.add<edm::InputTag>("scalers", edm::InputTag("scalersRawToDigi"));
318  desc.add<edm::InputTag>("onlineMetaDataDigis", edm::InputTag("onlineMetaDataDigis"));
319 
320  desc.add<std::string>("topDirName", "HLT/Tracking/ValidationWRTOffline");
321  desc.add<double>("dRmin", 0.002);
322 
323  desc.add<double>("pTCutForPlateau", 0.9);
324  desc.add<double>("dxyCutForPlateau", 2.5);
325  desc.add<double>("dzWRTPvCut", 1e6);
326 
329  desc.add<edm::ParameterSetDescription>("genericTriggerEventPSet", genericTriggerEventPSet);
330 
333  desc.add<edm::ParameterSetDescription>("histoPSet", histoPSet);
334 
335  descriptions.add("trackToTrackComparisonHists", desc);
336 }
static void fillHistoPSetDescription(edm::ParameterSetDescription &pset)
void add(std::string const &label, ParameterSetDescription const &psetDescription)
static void fillPSetDescription(edm::ParameterSetDescription &desc)

◆ fillHistoPSetDescription()

void TrackToTrackComparisonHists::fillHistoPSetDescription ( edm::ParameterSetDescription pset)
static

Definition at line 624 of file TrackToTrackComparisonHists.cc.

References muonDTDigis_cfi::pset.

Referenced by fillDescriptions().

624  {
625  pset.add<double>("Eta_rangeMin", -2.5);
626  pset.add<double>("Eta_rangeMax", 2.5);
627  pset.add<unsigned int>("Eta_nbin", 50);
628 
629  pset.add<double>("Pt_rangeMin", 0.1);
630  pset.add<double>("Pt_rangeMax", 100.0);
631  pset.add<unsigned int>("Pt_nbin", 1000);
632 
633  pset.add<double>("Phi_rangeMin", -3.1416);
634  pset.add<double>("Phi_rangeMax", 3.1416);
635  pset.add<unsigned int>("Phi_nbin", 36);
636 
637  pset.add<double>("Dxy_rangeMin", -1.0);
638  pset.add<double>("Dxy_rangeMax", 1.0);
639  pset.add<unsigned int>("Dxy_nbin", 300);
640 
641  pset.add<double>("Dz_rangeMin", -30.0);
642  pset.add<double>("Dz_rangeMax", 30.0);
643  pset.add<unsigned int>("Dz_nbin", 60);
644 
645  pset.add<double>("ptRes_rangeMin", -0.1);
646  pset.add<double>("ptRes_rangeMax", 0.1);
647  pset.add<unsigned int>("ptRes_nbin", 100);
648 
649  pset.add<double>("phiRes_rangeMin", -0.01);
650  pset.add<double>("phiRes_rangeMax", 0.01);
651  pset.add<unsigned int>("phiRes_nbin", 300);
652 
653  pset.add<double>("etaRes_rangeMin", -0.01);
654  pset.add<double>("etaRes_rangeMax", 0.01);
655  pset.add<unsigned int>("etaRes_nbin", 300);
656 
657  pset.add<double>("dxyRes_rangeMin", -0.05);
658  pset.add<double>("dxyRes_rangeMax", 0.05);
659  pset.add<unsigned int>("dxyRes_nbin", 500);
660 
661  pset.add<double>("dzRes_rangeMin", -0.05);
662  pset.add<double>("dzRes_rangeMax", 0.05);
663  pset.add<unsigned int>("dzRes_nbin", 150);
664 
665  pset.add<unsigned int>("ls_rangeMin", 0);
666  pset.add<unsigned int>("ls_rangeMax", 3000);
667  pset.add<unsigned int>("ls_nbin", 300);
668 
669  pset.add<double>("onlinelumi_rangeMin", 0.0);
670  pset.add<double>("onlinelumi_rangeMax", 20000.0);
671  pset.add<unsigned int>("onlinelumi_nbin", 200);
672 
673  pset.add<double>("PU_rangeMin", 0.0);
674  pset.add<double>("PU_rangeMax", 120.0);
675  pset.add<unsigned int>("PU_nbin", 120);
676 }

◆ fillMap()

void TrackToTrackComparisonHists::fillMap ( const edm::View< reco::Track > &  tracks1,
const edm::View< reco::Track > &  tracks2,
idx2idxByDoubleColl map,
float  dRMin 
)
protected

Definition at line 338 of file TrackToTrackComparisonHists.cc.

References reco::deltaR(), HGC3DClusterGenMatchSelector_cfi::dR, HLT_2024v14_cff::dRMin, mps_fire::i, dqmiolumiharvest::j, genParticles_cff::map, and createJobs::tmp.

Referenced by analyze().

341  {
342  //
343  // loop on tracks1
344  //
345  int i = 0;
346  for (const auto& track1 : tracks1) {
347  std::map<double, int> tmp;
348  int j = 0;
349  float smallest_dR = 1e9;
350  int smallest_dR_j = -1;
351 
352  //
353  // loop on tracks2
354  //
355  for (const auto& track2 : tracks2) {
356  double dR = reco::deltaR(track1.eta(), track1.phi(), track2.eta(), track2.phi());
357 
358  if (dR < smallest_dR) {
359  smallest_dR = dR;
360  smallest_dR_j = j;
361  }
362 
363  if (dR < dRMin) {
364  tmp[dR] = j;
365  }
366 
367  j++;
368  }
369 
370  //
371  // If there are no tracks that pass the dR store the smallest (for debugging/validating matching)
372  //
373  if (tmp.empty())
374  tmp[smallest_dR] = smallest_dR_j;
375 
376  map.push_back(std::make_pair(i, tmp));
377  i++;
378  }
379 }
constexpr auto deltaR(const T1 &t1, const T2 &t2) -> decltype(t1.eta())
Definition: deltaR.h:30
tmp
align.sh
Definition: createJobs.py:716

◆ initialize_parameter()

void TrackToTrackComparisonHists::initialize_parameter ( const edm::ParameterSet iConfig)
protected

Definition at line 568 of file TrackToTrackComparisonHists.cc.

References Dxy_nbin, Dxy_rangeMax, Dxy_rangeMin, dxyRes_nbin, dxyRes_rangeMax, dxyRes_rangeMin, Dz_nbin, Dz_rangeMax, Dz_rangeMin, dzRes_nbin, dzRes_rangeMax, dzRes_rangeMin, Eta_nbin, Eta_rangeMax, Eta_rangeMin, etaRes_nbin, etaRes_rangeMax, etaRes_rangeMin, edm::ParameterSet::getParameter(), ls_nbin, ls_rangeMax, ls_rangeMin, onlinelumi_nbin, onlinelumi_rangeMax, onlinelumi_rangeMin, Phi_nbin, Phi_rangeMax, Phi_rangeMin, phiRes_nbin, phiRes_rangeMax, phiRes_rangeMin, muonDTDigis_cfi::pset, Pt_nbin, Pt_rangeMax, Pt_rangeMin, ptRes_nbin, ptRes_rangeMax, ptRes_rangeMin, PU_nbin, PU_rangeMax, and PU_rangeMin.

Referenced by TrackToTrackComparisonHists().

568  {
569  const edm::ParameterSet& pset = iConfig.getParameter<edm::ParameterSet>("histoPSet");
570 
571  Eta_rangeMin = pset.getParameter<double>("Eta_rangeMin");
572  Eta_rangeMax = pset.getParameter<double>("Eta_rangeMax");
573  Eta_nbin = pset.getParameter<unsigned int>("Eta_nbin");
574 
575  Pt_rangeMin = pset.getParameter<double>("Pt_rangeMin");
576  Pt_rangeMax = pset.getParameter<double>("Pt_rangeMax");
577  Pt_nbin = pset.getParameter<unsigned int>("Pt_nbin");
578 
579  Phi_rangeMin = pset.getParameter<double>("Phi_rangeMin");
580  Phi_rangeMax = pset.getParameter<double>("Phi_rangeMax");
581  Phi_nbin = pset.getParameter<unsigned int>("Phi_nbin");
582 
583  Dxy_rangeMin = pset.getParameter<double>("Dxy_rangeMin");
584  Dxy_rangeMax = pset.getParameter<double>("Dxy_rangeMax");
585  Dxy_nbin = pset.getParameter<unsigned int>("Dxy_nbin");
586 
587  Dz_rangeMin = pset.getParameter<double>("Dz_rangeMin");
588  Dz_rangeMax = pset.getParameter<double>("Dz_rangeMax");
589  Dz_nbin = pset.getParameter<unsigned int>("Dz_nbin");
590 
591  ptRes_rangeMin = pset.getParameter<double>("ptRes_rangeMin");
592  ptRes_rangeMax = pset.getParameter<double>("ptRes_rangeMax");
593  ptRes_nbin = pset.getParameter<unsigned int>("ptRes_nbin");
594 
595  phiRes_rangeMin = pset.getParameter<double>("phiRes_rangeMin");
596  phiRes_rangeMax = pset.getParameter<double>("phiRes_rangeMax");
597  phiRes_nbin = pset.getParameter<unsigned int>("phiRes_nbin");
598 
599  etaRes_rangeMin = pset.getParameter<double>("etaRes_rangeMin");
600  etaRes_rangeMax = pset.getParameter<double>("etaRes_rangeMax");
601  etaRes_nbin = pset.getParameter<unsigned int>("etaRes_nbin");
602 
603  dxyRes_rangeMin = pset.getParameter<double>("dxyRes_rangeMin");
604  dxyRes_rangeMax = pset.getParameter<double>("dxyRes_rangeMax");
605  dxyRes_nbin = pset.getParameter<unsigned int>("dxyRes_nbin");
606 
607  dzRes_rangeMin = pset.getParameter<double>("dzRes_rangeMin");
608  dzRes_rangeMax = pset.getParameter<double>("dzRes_rangeMax");
609  dzRes_nbin = pset.getParameter<unsigned int>("dzRes_nbin");
610 
611  ls_rangeMin = pset.getParameter<unsigned int>("ls_rangeMin");
612  ls_rangeMax = pset.getParameter<unsigned int>("ls_rangeMax");
613  ls_nbin = pset.getParameter<unsigned int>("ls_nbin");
614 
615  onlinelumi_rangeMin = pset.getParameter<double>("onlinelumi_rangeMin");
616  onlinelumi_rangeMax = pset.getParameter<double>("onlinelumi_rangeMax");
617  onlinelumi_nbin = pset.getParameter<unsigned int>("onlinelumi_nbin");
618 
619  PU_rangeMin = pset.getParameter<double>("PU_rangeMin");
620  PU_rangeMax = pset.getParameter<double>("PU_rangeMax");
621  PU_nbin = pset.getParameter<unsigned int>("PU_nbin");
622 }
T getParameter(std::string const &) const
Definition: ParameterSet.h:307

Member Data Documentation

◆ dqmStore_

DQMStore* TrackToTrackComparisonHists::dqmStore_
protected

Definition at line 89 of file TrackToTrackComparisonHists.h.

◆ dRmin_

double TrackToTrackComparisonHists::dRmin_
private

Definition at line 107 of file TrackToTrackComparisonHists.h.

Referenced by analyze().

◆ Dxy_nbin

unsigned int TrackToTrackComparisonHists::Dxy_nbin
private

◆ Dxy_rangeMax

double TrackToTrackComparisonHists::Dxy_rangeMax
private

◆ Dxy_rangeMin

double TrackToTrackComparisonHists::Dxy_rangeMin
private

◆ dxyCutForPlateau_

double TrackToTrackComparisonHists::dxyCutForPlateau_
private

Definition at line 109 of file TrackToTrackComparisonHists.h.

Referenced by fill_generic_tracks_histos().

◆ dxyRes_nbin

unsigned int TrackToTrackComparisonHists::dxyRes_nbin
private

◆ dxyRes_rangeMax

double TrackToTrackComparisonHists::dxyRes_rangeMax
private

◆ dxyRes_rangeMin

double TrackToTrackComparisonHists::dxyRes_rangeMin
private

◆ Dz_nbin

unsigned int TrackToTrackComparisonHists::Dz_nbin
private

◆ Dz_rangeMax

double TrackToTrackComparisonHists::Dz_rangeMax
private

◆ Dz_rangeMin

double TrackToTrackComparisonHists::Dz_rangeMin
private

◆ dzRes_nbin

unsigned int TrackToTrackComparisonHists::dzRes_nbin
private

◆ dzRes_rangeMax

double TrackToTrackComparisonHists::dzRes_rangeMax
private

◆ dzRes_rangeMin

double TrackToTrackComparisonHists::dzRes_rangeMin
private

◆ dzWRTPvCut_

double TrackToTrackComparisonHists::dzWRTPvCut_
private

Definition at line 110 of file TrackToTrackComparisonHists.h.

Referenced by analyze().

◆ Eta_nbin

unsigned int TrackToTrackComparisonHists::Eta_nbin
private

◆ Eta_rangeMax

double TrackToTrackComparisonHists::Eta_rangeMax
private

◆ Eta_rangeMin

double TrackToTrackComparisonHists::Eta_rangeMin
private

◆ etaRes_nbin

unsigned int TrackToTrackComparisonHists::etaRes_nbin
private

◆ etaRes_rangeMax

double TrackToTrackComparisonHists::etaRes_rangeMax
private

◆ etaRes_rangeMin

double TrackToTrackComparisonHists::etaRes_rangeMin
private

◆ genTriggerEventFlag_

std::unique_ptr<GenericTriggerEventFlag> TrackToTrackComparisonHists::genTriggerEventFlag_
private

◆ hltPathsAreValid_

bool TrackToTrackComparisonHists::hltPathsAreValid_ = false
private

Definition at line 112 of file TrackToTrackComparisonHists.h.

Referenced by analyze(), and bookHistograms().

◆ ls_nbin

unsigned int TrackToTrackComparisonHists::ls_nbin
private

◆ ls_rangeMax

unsigned int TrackToTrackComparisonHists::ls_rangeMax
private

◆ ls_rangeMin

unsigned int TrackToTrackComparisonHists::ls_rangeMin
private

◆ lumiScalersToken_

edm::EDGetTokenT<LumiScalersCollection> TrackToTrackComparisonHists::lumiScalersToken_
protected

Definition at line 101 of file TrackToTrackComparisonHists.h.

Referenced by analyze(), and TrackToTrackComparisonHists().

◆ matchedReferenceTracksMEs_

generalME TrackToTrackComparisonHists::matchedReferenceTracksMEs_
private

◆ matchTracksMEs_

matchingME TrackToTrackComparisonHists::matchTracksMEs_
private

◆ monitoredBSToken_

edm::EDGetTokenT<reco::BeamSpot> TrackToTrackComparisonHists::monitoredBSToken_
protected

Definition at line 97 of file TrackToTrackComparisonHists.h.

Referenced by analyze(), and TrackToTrackComparisonHists().

◆ monitoredPVToken_

edm::EDGetTokenT<reco::VertexCollection> TrackToTrackComparisonHists::monitoredPVToken_
protected

Definition at line 99 of file TrackToTrackComparisonHists.h.

Referenced by analyze(), and TrackToTrackComparisonHists().

◆ monitoredTrackInputTag_

edm::InputTag TrackToTrackComparisonHists::monitoredTrackInputTag_
protected

Definition at line 91 of file TrackToTrackComparisonHists.h.

Referenced by analyze(), and TrackToTrackComparisonHists().

◆ monitoredTracksMEs_

generalME TrackToTrackComparisonHists::monitoredTracksMEs_
private

◆ monitoredTrackToken_

edm::EDGetTokenT<edm::View<reco::Track> > TrackToTrackComparisonHists::monitoredTrackToken_
protected

Definition at line 95 of file TrackToTrackComparisonHists.h.

Referenced by analyze(), and TrackToTrackComparisonHists().

◆ onlinelumi_nbin

unsigned int TrackToTrackComparisonHists::onlinelumi_nbin
private

◆ onlinelumi_rangeMax

double TrackToTrackComparisonHists::onlinelumi_rangeMax
private

◆ onlinelumi_rangeMin

double TrackToTrackComparisonHists::onlinelumi_rangeMin
private

◆ onlineMetaDataDigisToken_

edm::EDGetTokenT<OnlineLuminosityRecord> TrackToTrackComparisonHists::onlineMetaDataDigisToken_
protected

Definition at line 102 of file TrackToTrackComparisonHists.h.

Referenced by analyze(), and TrackToTrackComparisonHists().

◆ Phi_nbin

unsigned int TrackToTrackComparisonHists::Phi_nbin
private

◆ Phi_rangeMax

double TrackToTrackComparisonHists::Phi_rangeMax
private

◆ Phi_rangeMin

double TrackToTrackComparisonHists::Phi_rangeMin
private

◆ phiRes_nbin

unsigned int TrackToTrackComparisonHists::phiRes_nbin
private

◆ phiRes_rangeMax

double TrackToTrackComparisonHists::phiRes_rangeMax
private

◆ phiRes_rangeMin

double TrackToTrackComparisonHists::phiRes_rangeMin
private

◆ Pt_nbin

unsigned int TrackToTrackComparisonHists::Pt_nbin
private

◆ Pt_rangeMax

double TrackToTrackComparisonHists::Pt_rangeMax
private

◆ Pt_rangeMin

double TrackToTrackComparisonHists::Pt_rangeMin
private

◆ pTCutForPlateau_

double TrackToTrackComparisonHists::pTCutForPlateau_
private

Definition at line 108 of file TrackToTrackComparisonHists.h.

Referenced by fill_generic_tracks_histos().

◆ ptRes_nbin

unsigned int TrackToTrackComparisonHists::ptRes_nbin
private

◆ ptRes_rangeMax

double TrackToTrackComparisonHists::ptRes_rangeMax
private

◆ ptRes_rangeMin

double TrackToTrackComparisonHists::ptRes_rangeMin
private

◆ PU_nbin

unsigned int TrackToTrackComparisonHists::PU_nbin
private

◆ PU_rangeMax

double TrackToTrackComparisonHists::PU_rangeMax
private

◆ PU_rangeMin

double TrackToTrackComparisonHists::PU_rangeMin
private

◆ referenceBSToken_

edm::EDGetTokenT<reco::BeamSpot> TrackToTrackComparisonHists::referenceBSToken_
protected

Definition at line 98 of file TrackToTrackComparisonHists.h.

Referenced by analyze(), and TrackToTrackComparisonHists().

◆ referencePVToken_

edm::EDGetTokenT<reco::VertexCollection> TrackToTrackComparisonHists::referencePVToken_
protected

Definition at line 100 of file TrackToTrackComparisonHists.h.

Referenced by analyze(), and TrackToTrackComparisonHists().

◆ referenceTrackInputTag_

edm::InputTag TrackToTrackComparisonHists::referenceTrackInputTag_
protected

Definition at line 92 of file TrackToTrackComparisonHists.h.

Referenced by analyze(), and TrackToTrackComparisonHists().

◆ referenceTracksMEs_

generalME TrackToTrackComparisonHists::referenceTracksMEs_
private

◆ referenceTrackToken_

edm::EDGetTokenT<edm::View<reco::Track> > TrackToTrackComparisonHists::referenceTrackToken_
protected

Definition at line 96 of file TrackToTrackComparisonHists.h.

Referenced by analyze(), and TrackToTrackComparisonHists().

◆ requireValidHLTPaths_

bool TrackToTrackComparisonHists::requireValidHLTPaths_
private

Definition at line 111 of file TrackToTrackComparisonHists.h.

Referenced by analyze(), and bookHistograms().

◆ topDirName_

std::string TrackToTrackComparisonHists::topDirName_
private

Definition at line 106 of file TrackToTrackComparisonHists.h.

Referenced by bookHistograms().

◆ unMatchedMonitoredTracksMEs_

generalME TrackToTrackComparisonHists::unMatchedMonitoredTracksMEs_
private