CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Member Functions | Private Attributes
recoBSVTagInfoValidationAnalyzer Class Reference
Inheritance diagram for recoBSVTagInfoValidationAnalyzer:
edm::EDAnalyzer edm::EDConsumerBase

Public Member Functions

 recoBSVTagInfoValidationAnalyzer (const edm::ParameterSet &)
 
- Public Member Functions inherited from edm::EDAnalyzer
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 EDAnalyzer ()
 
ModuleDescription const & moduleDescription () const
 
std::string workerType () const
 
virtual ~EDAnalyzer ()
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
 EDConsumerBase ()
 
ProductHolderIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
std::vector
< ProductHolderIndexAndSkipBit >
const & 
itemsToGetFromEvent () const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesDependentUpon (const std::string &iProcessName, std::vector< const char * > &oModuleLabels) const
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
bool registeredToConsume (ProductHolderIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductHolderIndexHelper const &)
 
virtual ~EDConsumerBase ()
 

Private Member Functions

virtual void analyze (const edm::Event &, const edm::EventSetup &) override
 
void bookRecoToSim (std::string const &)
 
void bookSimToReco (std::string const &)
 
virtual void endJob () override
 
void fillRecoToSim (std::string const &, reco::Vertex const &, TrackingVertexRef const &)
 
void fillSimToReco (std::string const &, reco::VertexBaseRef const &, TrackingVertexRef const &)
 

Private Attributes

VertexClassifierByProxy
< reco::SecondaryVertexTagInfoCollection
classifier_
 
std::string dqmLabel
 
DQMStoredqmStore_
 
std::map< std::string,
MonitorElement * > 
HistIndex_
 
Int_t n_event
 
Int_t numberVertexClassifier_
 
Int_t rs_total_nall
 
Int_t rs_total_nbsv
 
Int_t rs_total_nbv
 
Int_t rs_total_ncv
 
Int_t rs_total_nlv
 
Int_t rs_total_nsv
 
Int_t sr_total_nall
 
Int_t sr_total_nbsv
 
Int_t sr_total_nbv
 
Int_t sr_total_ncv
 
Int_t sr_total_nlv
 
Int_t sr_total_nsv
 
edm::EDGetTokenT
< reco::SecondaryVertexTagInfoCollection
svInfoToken
 
edm::InputTag svTagInfoProducer_
 
Int_t total_nfake
 
Int_t total_nmiss
 
edm::InputTag trackingTruth_
 
edm::EDGetTokenT
< TrackingVertexCollection
tvToken
 

Additional Inherited Members

- Public Types inherited from edm::EDAnalyzer
typedef EDAnalyzer ModuleType
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Static Public Member Functions inherited from edm::EDAnalyzer
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &)
 
- Protected Member Functions inherited from edm::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken consumes (TypeToGet const &id, edm::InputTag const &tag)
 
ConsumesCollector consumesCollector ()
 Use a ConsumesCollector to gather consumes information from helper functions. More...
 
template<typename ProductType , BranchType B = InEvent>
void consumesMany ()
 
void consumesMany (const TypeToGet &id)
 
template<BranchType B>
void consumesMany (const TypeToGet &id)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 

Detailed Description

Definition at line 37 of file recoBSVTagInfoValidationAnalyzer.cc.

Constructor & Destructor Documentation

recoBSVTagInfoValidationAnalyzer::recoBSVTagInfoValidationAnalyzer ( const edm::ParameterSet config)
explicit

Definition at line 95 of file recoBSVTagInfoValidationAnalyzer.cc.

References bookRecoToSim(), bookSimToReco(), dqmLabel, dqmStore_, edm::ParameterSet::getParameter(), getTH1F(), HistIndex_, i, n_event, VertexCategories::Names, numberVertexClassifier_, cppFunctionSkipper::operator, rs_total_nall, rs_total_nbsv, rs_total_nbv, rs_total_ncv, rs_total_nlv, rs_total_nsv, sr_total_nall, sr_total_nbsv, sr_total_nbv, sr_total_ncv, sr_total_nlv, sr_total_nsv, svInfoToken, total_nfake, total_nmiss, tvToken, and VertexCategories::Unknown.

95  : classifier_(config,consumesCollector())
96 {
97  //Initialize counters
98  n_event = 0;
99  rs_total_nall = 0;
100  rs_total_nsv = 0;
101  rs_total_nbv = 0;
102  rs_total_nbsv = 0;
103  rs_total_ncv = 0;
104  rs_total_nlv = 0;
105  total_nfake = 0;
106 
107  sr_total_nall = 0;
108  sr_total_nsv = 0;
109  sr_total_nbv = 0;
110  sr_total_nbsv = 0;
111  sr_total_ncv = 0;
112  sr_total_nlv = 0;
113  total_nmiss = 0;
114 
115  // get the store
117  dqmLabel = "SVValidation/";
118  dqmStore_->setCurrentFolder(dqmLabel);
119 
120 
121  // Get the track collection
122  svInfoToken = consumes<reco::SecondaryVertexTagInfoCollection>(config.getParameter<InputTag>("svTagInfoProducer"));
123  // Name of the traking pariticle collection
124  tvToken = consumes<TrackingVertexCollection>(config.getParameter<InputTag>("trackingTruth"));
125  // Number of track categories
127 
128  // Define histogram for counting categories
129  HistIndex_["VertexClassifier"] = dqmStore_->book1D(
130  "VertexClassifier",
131  "Frequency for the different track categories",
133  -0.5,
135  );
136 
137  //--- RecoToSim
138  HistIndex_["rs_All_MatchQuality"]= dqmStore_->book1D( "rs_All_MatchQuality", "Quality of Match", 51, -0.01, 1.01 );
139  HistIndex_["rs_All_FlightDistance2d"]= dqmStore_->book1D( "rs_All_FlightDistance2d", "Transverse flight distance [cm]", 100, 0, 5 );
140  HistIndex_["rs_SecondaryVertex_FlightDistance2d"]= dqmStore_->book1D( "rs_SecondaryVertex_FlightDistance2d", "Transverse flight distance [cm]", 100, 0, 5 );
141  HistIndex_["rs_BSV_FlightDistance2d"]= dqmStore_->book1D( "rs_BSV_FlightDistance2d", "Transverse flight distance [cm]", 100, 0, 5 );
142  HistIndex_["rs_BWeakDecay_FlightDistance2d"]= dqmStore_->book1D( "rs_BWeakDecay_FlightDistance2d", "Transverse flight distance [cm]", 100, 0, 5 );
143  HistIndex_["rs_CWeakDecay_FlightDistance2d"]= dqmStore_->book1D( "rs_CWeakDecay_FlightDistance2d", "Transverse flight distance [cm]", 100, 0, 5 );
144  HistIndex_["rs_Light_FlightDistance2d"]= dqmStore_->book1D( "rs_Light_FlightDistance2d", "Transverse flight distance [cm]", 100, 0, 5 );
145 
146  HistIndex_["rs_All_nRecVtx"]= dqmStore_->book1D( "rs_All_nRecVtx", "Number of Vertices per event", 11, -0.5, 10.5 );
147  HistIndex_["rs_SecondaryVertex_nRecVtx"]= dqmStore_->book1D( "rs_SecondaryVertex_nRecVtx", "Number of Vertices per event", 11, -0.5, 10.5 );
148  HistIndex_["rs_BSV_nRecVtx"]= dqmStore_->book1D( "rs_BSV_nRecVtx", "Number of Vertices per event", 11, -0.5, 10.5 );
149  HistIndex_["rs_BWeakDecay_nRecVtx"]= dqmStore_->book1D( "rs_BWeakDecay_nRecVtx", "Number of Vertices per event", 11, -0.5, 10.5 );
150  HistIndex_["rs_CWeakDecay_nRecVtx"]= dqmStore_->book1D( "rs_CWeakDecay_nRecVtx", "Number of Vertices per event", 11, -0.5, 10.5 );
151  HistIndex_["rs_Light_nRecVtx"]= dqmStore_->book1D( "rs_Light_nRecVtx", "Number of Vertices per event", 11, -0.5, 10.5 );
152 
153 
154  //--- SimToReco
155  HistIndex_["sr_All_MatchQuality"]= dqmStore_->book1D( "sr_All_MatchQuality", "Quality of Match", 51, -0.01, 1.01 );
156  HistIndex_["sr_All_nRecVtx"]= dqmStore_->book1D( "sr_All_nRecVtx", "Number of Vertices per event", 11, -0.5, 10.5 );
157  HistIndex_["sr_SecondaryVertex_nRecVtx"]= dqmStore_->book1D( "sr_SecondaryVertex_nRecVtx", "Number of Vertices per event", 11, -0.5, 10.5 );
158  HistIndex_["sr_BSV_nRecVtx"]= dqmStore_->book1D( "sr_BSV_nRecVtx", "Number of Vertices per event", 11, -0.5, 10.5 );
159  HistIndex_["sr_BWeakDecay_nRecVtx"]= dqmStore_->book1D( "sr_BWeakDecay_nRecVtx", "Number of Vertices per event", 11, -0.5, 10.5 );
160  HistIndex_["sr_CWeakDecay_nRecVtx"]= dqmStore_->book1D( "sr_CWeakDecay_nRecVtx", "Number of Vertices per event", 11, -0.5, 10.5 );
161  HistIndex_["sr_Light_nRecVtx"]= dqmStore_->book1D( "sr_Light_nRecVtx", "Number of Vertices per event", 11, -0.5, 10.5 );
162 
163 
164  // Set the proper categories names
165  for (Int_t i = 0; i < numberVertexClassifier_; ++i)
166  HistIndex_["VertexClassifier"]->getTH1F()->GetXaxis()->SetBinLabel(i+1, VertexCategories::Names[i]);
167 
168  // book histograms
169  bookRecoToSim("rs_All");
170  bookRecoToSim("rs_SecondaryVertex");
171  bookRecoToSim("rs_BSV");
172  bookRecoToSim("rs_BWeakDecay");
173  bookRecoToSim("rs_CWeakDecay");
174  bookRecoToSim("rs_Light");
175 
176  bookSimToReco("sr_All");
177  bookSimToReco("sr_SecondaryVertex");
178  bookSimToReco("sr_BSV");
179  bookSimToReco("sr_BWeakDecay");
180  bookSimToReco("sr_CWeakDecay");
181  bookSimToReco("sr_Light");
182 }
T getParameter(std::string const &) const
int i
Definition: DBlmapReader.cc:9
ConsumesCollector consumesCollector()
Use a ConsumesCollector to gather consumes information from helper functions.
VertexClassifierByProxy< reco::SecondaryVertexTagInfoCollection > classifier_
edm::EDGetTokenT< TrackingVertexCollection > tvToken
std::map< std::string, MonitorElement * > HistIndex_
TH1F * getTH1F(std::string name, std::string process, std::string rootfolder, DQMStore *dbe_, bool verb, bool clone)
static const char *const Names[]
Name of the different categories.
edm::EDGetTokenT< reco::SecondaryVertexTagInfoCollection > svInfoToken

Member Function Documentation

void recoBSVTagInfoValidationAnalyzer::analyze ( const edm::Event event,
const edm::EventSetup setup 
)
overrideprivatevirtual

Implements edm::EDAnalyzer.

Definition at line 185 of file recoBSVTagInfoValidationAnalyzer.cc.

References VertexCategories::BWeakDecay, classifier_, gather_cfg::cout, VertexCategories::CWeakDecay, VertexClassifierByProxy< Collection >::evaluate(), VertexCategories::Fake, fillRecoToSim(), fillSimToReco(), HistIndex_, VertexClassifier::history(), i, cmsHarvester::index, VertexCategories::is(), n_event, VertexClassifierByProxy< Collection >::newEvent(), numberVertexClassifier_, VertexHistory::quality(), VertexCategories::Reconstructed, VertexHistory::recoVertex(), rs_total_nall, rs_total_nbsv, rs_total_nbv, rs_total_ncv, rs_total_nlv, rs_total_nsv, VertexCategories::SecondaryVertex, HistoryBase::simVertex(), sr_total_nall, sr_total_nbsv, sr_total_nbv, sr_total_ncv, sr_total_nlv, sr_total_nsv, svInfoToken, total_nfake, total_nmiss, and tvToken.

186 {
187  ++n_event;
188 
189  std::cout << "*** Analyzing " << event.id() << " n_event = " << n_event << std::endl << std::endl;
190 
191  // Set the classifier for a new event
192  classifier_.newEvent(event, setup);
193 
194 
195  // Vertex collection
197  event.getByToken(svInfoToken, svTagInfoCollection);
198  // Get a constant reference to the track history associated to the classifier
199  VertexHistory const & tracer = classifier_.history();
200 
201  cout << "* Event " << n_event << " ; svTagInfoCollection->size() = " << svTagInfoCollection->size() << endl;
202 
203  int rs_nall = 0;
204  int rs_nsv = 0;
205  int rs_nbv = 0;
206  int rs_nbsv = 0;
207  int rs_ncv = 0;
208  int rs_nlv = 0;
209  int nfake = 0;
210 
211  int sr_nall = 0;
212  int sr_nsv = 0;
213  int sr_nbv = 0;
214  int sr_nbsv = 0;
215  int sr_ncv = 0;
216  int sr_nlv = 0;
217  int nmiss = 0;
218 
219  // Loop over the svTagInfo collection.
220  for (std::size_t index = 0; index < svTagInfoCollection->size(); ++index){
221 
222  reco::SecondaryVertexTagInfoRef svTagInfo(svTagInfoCollection, index);
223 
224  // Loop over the vertexes in svTagInfo
225  for ( std::size_t vindex = 0; vindex < svTagInfo->nVertices(); ++vindex ){
226 
227 
228  // Classify the vertices
229  classifier_.evaluate(svTagInfo, vindex);
230 
231  //quality of the match
232  double rs_quality = tracer.quality();
233 
234  // Fill the histogram with the categories
235  for (Int_t i = 0; i != numberVertexClassifier_; ++i) {
236 
238 
239  HistIndex_["VertexClassifier"]->Fill(i);
240  }
241  }
243 
244  HistIndex_["rs_All_MatchQuality"]->Fill( rs_quality );
245  fillRecoToSim("rs_All", svTagInfo->secondaryVertex(vindex), tracer.simVertex());
246  HistIndex_["rs_All_FlightDistance2d"]->Fill( svTagInfo->flightDistance( vindex, true ).value() );
247  rs_nall++;
248 
250 
251  fillRecoToSim("rs_SecondaryVertex", svTagInfo->secondaryVertex(vindex), tracer.simVertex());
252  HistIndex_["rs_SecondaryVertex_FlightDistance2d"]->Fill( svTagInfo->flightDistance( vindex, true ).value() );
253  rs_nsv++;
254  }
255 
257 
258  fillRecoToSim("rs_BWeakDecay", svTagInfo->secondaryVertex(vindex), tracer.simVertex());
259  HistIndex_["rs_BWeakDecay_FlightDistance2d"]->Fill( svTagInfo->flightDistance( vindex, true ).value() );
260  rs_nbv++;
261 
263 
264  fillRecoToSim("rs_BSV", svTagInfo->secondaryVertex(vindex), tracer.simVertex());
265  HistIndex_["rs_BSV_FlightDistance2d"]->Fill( svTagInfo->flightDistance( vindex, true ).value() );
266  rs_nbsv++;
267 
268  }
269  }//BWeakDecay
270 
272 
273  fillRecoToSim("rs_CWeakDecay", svTagInfo->secondaryVertex(vindex), tracer.simVertex());
274  HistIndex_["rs_CWeakDecay_FlightDistance2d"]->Fill( svTagInfo->flightDistance( vindex, true ).value() );
275  rs_ncv++;
276 
277  }
278  else {
279 
280  fillRecoToSim("rs_Light", svTagInfo->secondaryVertex(vindex), tracer.simVertex());
281  HistIndex_["rs_Light_FlightDistance2d"]->Fill( svTagInfo->flightDistance( vindex, true ).value() );
282  rs_nlv++;
283  }
284  }//end if classifier
285 
286  else {
287  cout << " VertexCategories::Fake!!" << endl;
288  nfake++;
289  }
290 
291 
292  }//end loop over vertices in svTagInfo
293 
294  }//loop over svTagInfo
295 
296  HistIndex_["rs_All_nRecVtx"]->Fill( rs_nall );
297  HistIndex_["rs_SecondaryVertex_nRecVtx"]->Fill( rs_nsv );
298  HistIndex_["rs_BWeakDecay_nRecVtx"]->Fill( rs_nbv );
299  HistIndex_["rs_BSV_nRecVtx"]->Fill( rs_nbsv );
300  HistIndex_["rs_CWeakDecay_nRecVtx"]->Fill( rs_ncv );
301  HistIndex_["rs_Light_nRecVtx"]->Fill( rs_nlv );
302  cout << endl;
303 
304  //----------------------------------------------------------------
305  // SIM TO RECO!
306 
307  // Vertex collection
309  event.getByToken(tvToken, TVCollection);
310  // Loop over the TV collection.
311  for (std::size_t index = 0; index < TVCollection->size(); ++index){
312 
313  TrackingVertexRef trackingVertex(TVCollection, index);
314 
315  classifier_.evaluate(trackingVertex);
316 
317  double sr_quality = tracer.quality();
318 
320 
321  HistIndex_["sr_All_MatchQuality"]->Fill( sr_quality );
322  fillSimToReco("sr_All", tracer.recoVertex(), trackingVertex);
323  sr_nall++;
324 
326 
327  fillSimToReco("sr_SecondaryVertex", tracer.recoVertex(), trackingVertex);
328  sr_nsv++;
329  }
330 
332 
333  fillSimToReco("sr_BWeakDecay", tracer.recoVertex(), trackingVertex);
334  sr_nbv++;
335 
337 
338  fillSimToReco("sr_BSV", tracer.recoVertex(), trackingVertex);
339  sr_nbsv++;
340  }
341 
342  }//BWeakDecay
343 
345 
346  fillSimToReco("sr_CWeakDecay", tracer.recoVertex(), trackingVertex);
347  sr_ncv++;
348  }
349 
350  else {
351 
352  fillSimToReco("sr_Light", tracer.recoVertex(), trackingVertex);
353  sr_nlv++;
354  }
355 
356  }//Reconstructed
357  else {
358  //cout << "##### Not reconstructed!" << endl;
359  nmiss++;
360  }
361 
362  }//TVCollection.size()
363 
364  HistIndex_["sr_All_nRecVtx"]->Fill( sr_nall );
365  HistIndex_["sr_SecondaryVertex_nRecVtx"]->Fill( sr_nsv );
366  HistIndex_["sr_BWeakDecay_nRecVtx"]->Fill( sr_nbv );
367  HistIndex_["sr_BSV_nRecVtx"]->Fill( sr_nbsv );
368  HistIndex_["sr_CWeakDecay_nRecVtx"]->Fill( sr_ncv );
369  HistIndex_["sr_Light_nRecVtx"]->Fill( rs_nlv );
370 
371  rs_total_nall += rs_nall;
372  rs_total_nsv += rs_nsv;
373  rs_total_nbv += rs_nbv;
374  rs_total_nbsv += rs_nbsv;
375  rs_total_ncv += rs_ncv ;
376  rs_total_nlv += rs_nlv;
377  total_nfake += nfake;
378 
379  sr_total_nall += sr_nall;
380  sr_total_nsv += sr_nsv;
381  sr_total_nbv += sr_nbv;
382  sr_total_nbsv += sr_nbsv;
383  sr_total_ncv += sr_ncv;
384  sr_total_nlv += sr_nlv;
385  total_nmiss += nmiss;
386 
387 
388 }
This class traces the simulated and generated history of a given track.
Definition: VertexHistory.h:18
int i
Definition: DBlmapReader.cc:9
VertexHistory const & history() const
Returns a reference to the vertex history used in the classification.
const reco::VertexBaseRef & recoVertex() const
Return a reference to the reconstructed track.
Definition: VertexHistory.h:64
void fillSimToReco(std::string const &, reco::VertexBaseRef const &, TrackingVertexRef const &)
Category
Categories available to vertexes.
VertexClassifierByProxy< reco::SecondaryVertexTagInfoCollection > classifier_
edm::EDGetTokenT< TrackingVertexCollection > tvToken
std::map< std::string, MonitorElement * > HistIndex_
bool is(Category category) const
Returns track flag for a given category.
const TrackingVertexRef & simVertex() const
Return the initial tracking vertex from the history.
Definition: HistoryBase.h:83
VertexClassifierByProxy< Collection > const & evaluate(TrackingVertexRef const &vertex)
Classify the TrackingVertex in categories.
virtual void newEvent(edm::Event const &event, edm::EventSetup const &config)
Pre-process event information (for accessing reconstraction information).
tuple cout
Definition: gather_cfg.py:121
double quality() const
Return the quality of the match.
Definition: VertexHistory.h:70
void fillRecoToSim(std::string const &, reco::Vertex const &, TrackingVertexRef const &)
edm::EDGetTokenT< reco::SecondaryVertexTagInfoCollection > svInfoToken
void recoBSVTagInfoValidationAnalyzer::bookRecoToSim ( std::string const &  prefix)
private

Definition at line 391 of file recoBSVTagInfoValidationAnalyzer.cc.

References dqmStore_, HistIndex_, mergeVDriftHistosByStation::name, and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by recoBSVTagInfoValidationAnalyzer().

391  {
392  // Book pull histograms
393 
394  std::string name = prefix + "_Pullx";
395  HistIndex_[name] = dqmStore_->book1D(name.c_str(), name.c_str(), 100, -10., 10.);
396  name = prefix + "_Pully";
397  HistIndex_[name] = dqmStore_->book1D(name.c_str(), name.c_str(), 100, -10., 10.);
398  name = prefix + "_Pullz";
399  HistIndex_[name] = dqmStore_->book1D(name.c_str(), name.c_str(), 100, -10., 10.);
400 
401  name = prefix + "_Resx";
402  HistIndex_[name] = dqmStore_->book1D(name.c_str(), name.c_str(), 100, -0.05, 0.05);
403  name = prefix + "_Resy";
404  HistIndex_[name] = dqmStore_->book1D(name.c_str(), name.c_str(), 100, -0.05, 0.05);
405  name = prefix + "_Resz";
406  HistIndex_[name] = dqmStore_->book1D(name.c_str(), name.c_str(), 100, -0.05, 0.05);
407 
408  name = prefix + "_Chi2Norm";
409  HistIndex_[name] = dqmStore_->book1D(name.c_str(), name.c_str(), 100, 0, 10.);
410  name = prefix + "_Chi2Prob";
411  HistIndex_[name] = dqmStore_->book1D(name.c_str(), name.c_str(), 100, 0., 1.);
412 
413  name = prefix + "_nRecTrks";
414  HistIndex_[name] = dqmStore_->book1D(name.c_str(), name.c_str(), 501, -0.5, 500.5);
415 
416  name = prefix + "_AverageTrackWeight";
417  HistIndex_[name] = dqmStore_->book1D(name.c_str(), name.c_str(), 100, -0.1, 1.1);
418 
419  name = prefix + "_Mass";
420  HistIndex_[name] = dqmStore_->book1D(name.c_str(), name.c_str(), 65, 0., 6.5);
421 
422  name = prefix + "_RecPt";
423  HistIndex_[name] = dqmStore_->book1D(name.c_str(), name.c_str(), 2000, 0., 1000.);
424 
425  name = prefix + "_RecEta";
426  HistIndex_[name] = dqmStore_->book1D(name.c_str(), name.c_str(), 200, -3., 3.);
427 
428  name = prefix + "_RecCharge";
429  HistIndex_[name] = dqmStore_->book1D(name.c_str(), name.c_str(), 21, -0.5, 20.5);
430 
431  name = prefix + "_RecTrackPt";
432  HistIndex_[name] = dqmStore_->book1D(name.c_str(), name.c_str(), 2000, 0., 1000.);
433 
434  name = prefix + "_RecTrackEta";
435  HistIndex_[name] = dqmStore_->book1D(name.c_str(), name.c_str(), 200, -3., 3.);
436 
437  name = prefix + "_nSimTrks";
438  HistIndex_[name] = dqmStore_->book1D(name.c_str(), name.c_str(), 501, -0.5, 500.5);
439 
440  name = prefix + "_SimPt";
441  HistIndex_[name] = dqmStore_->book1D(name.c_str(), name.c_str(), 2000, 0., 1000.);
442 
443  name = prefix + "_SimEta";
444  HistIndex_[name] = dqmStore_->book1D(name.c_str(), name.c_str(), 200, -3., 3.);
445 
446  name = prefix + "_SimCharge";
447  HistIndex_[name] = dqmStore_->book1D(name.c_str(), name.c_str(), 21, -0.5, 20.5);
448 
449  name = prefix + "_SimTrackPt";
450  HistIndex_[name] = dqmStore_->book1D(name.c_str(), name.c_str(), 500, 0., 500.);
451 
452  name = prefix + "_SimTrackEta";
453  HistIndex_[name] = dqmStore_->book1D(name.c_str(), name.c_str(), 200, -3., 3.);
454 
455 
456 }
std::map< std::string, MonitorElement * > HistIndex_
void recoBSVTagInfoValidationAnalyzer::bookSimToReco ( std::string const &  prefix)
private

Definition at line 459 of file recoBSVTagInfoValidationAnalyzer.cc.

References dqmStore_, HistIndex_, mergeVDriftHistosByStation::name, and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by recoBSVTagInfoValidationAnalyzer().

459  {
460  // Book pull histograms
461 
462  std::string name = prefix + "_Pullx";
463  HistIndex_[name] = dqmStore_->book1D(name.c_str(), name.c_str(), 100, -10., 10.);
464  name = prefix + "_Pully";
465  HistIndex_[name] = dqmStore_->book1D(name.c_str(), name.c_str(), 100, -10., 10.);
466  name = prefix + "_Pullz";
467  HistIndex_[name] = dqmStore_->book1D(name.c_str(), name.c_str(), 100, -10., 10.);
468 
469  name = prefix + "_Resx";
470  HistIndex_[name] = dqmStore_->book1D(name.c_str(), name.c_str(), 100, -0.05, 0.05);
471  name = prefix + "_Resy";
472  HistIndex_[name] = dqmStore_->book1D(name.c_str(), name.c_str(), 100, -0.05, 0.05);
473  name = prefix + "_Resz";
474  HistIndex_[name] = dqmStore_->book1D(name.c_str(), name.c_str(), 100, -0.05, 0.05);
475 
476  name = prefix + "_Chi2Norm";
477  HistIndex_[name] = dqmStore_->book1D(name.c_str(), name.c_str(), 100, 0, 10.);
478  name = prefix + "_Chi2Prob";
479  HistIndex_[name] = dqmStore_->book1D(name.c_str(), name.c_str(), 100, 0., 1.);
480 
481  name = prefix + "_nRecTrks";
482  HistIndex_[name] = dqmStore_->book1D(name.c_str(), name.c_str(), 501, -0.5, 500.5);
483 
484  name = prefix + "_AverageTrackWeight";
485  HistIndex_[name] = dqmStore_->book1D(name.c_str(), name.c_str(), 100, -0.1, 1.1);
486 
487  name = prefix + "_Mass";
488  HistIndex_[name] = dqmStore_->book1D(name.c_str(), name.c_str(), 65, 0., 6.5);
489 
490  name = prefix + "_RecPt";
491  HistIndex_[name] = dqmStore_->book1D(name.c_str(), name.c_str(), 2000, 0., 1000.);
492 
493  name = prefix + "_RecEta";
494  HistIndex_[name] = dqmStore_->book1D(name.c_str(), name.c_str(), 200, -3., 3.);
495 
496  name = prefix + "_RecCharge";
497  HistIndex_[name] = dqmStore_->book1D(name.c_str(), name.c_str(), 21, -0.5, 20.5);
498 
499  name = prefix + "_RecTrackPt";
500  HistIndex_[name] = dqmStore_->book1D(name.c_str(), name.c_str(), 2000, 0., 1000.);
501 
502  name = prefix + "_RecTrackEta";
503  HistIndex_[name] = dqmStore_->book1D(name.c_str(), name.c_str(), 200, -3., 3.);
504 
505  name = prefix + "_nSimTrks";
506  HistIndex_[name] = dqmStore_->book1D(name.c_str(), name.c_str(), 501, -0.5, 500.5);
507 
508  name = prefix + "_SimPt";
509  HistIndex_[name] = dqmStore_->book1D(name.c_str(), name.c_str(), 2000, 0., 1000.);
510 
511  name = prefix + "_SimEta";
512  HistIndex_[name] = dqmStore_->book1D(name.c_str(), name.c_str(), 200, -3., 3.);
513 
514  name = prefix + "_SimCharge";
515  HistIndex_[name] = dqmStore_->book1D(name.c_str(), name.c_str(), 21, -0.5, 20.5);
516 
517  name = prefix + "_SimTrackPt";
518  HistIndex_[name] = dqmStore_->book1D(name.c_str(), name.c_str(), 500, 0., 500.);
519 
520  name = prefix + "_SimTrackEta";
521  HistIndex_[name] = dqmStore_->book1D(name.c_str(), name.c_str(), 200, -3., 3.);
522 
523 
524 }
std::map< std::string, MonitorElement * > HistIndex_
void recoBSVTagInfoValidationAnalyzer::endJob ( void  )
overrideprivatevirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 710 of file recoBSVTagInfoValidationAnalyzer.cc.

References gather_cfg::cout, n_event, rs_total_nall, rs_total_nbsv, rs_total_nbv, rs_total_ncv, rs_total_nlv, rs_total_nsv, sr_total_nall, sr_total_nbsv, sr_total_nbv, sr_total_ncv, sr_total_nlv, sr_total_nsv, and total_nfake.

710  {
711 
712  std::cout << std::endl;
713  std::cout << " ====== Total Number of analyzed events: " << n_event << " ====== " << std::endl;
714  std::cout << " ====== Total Number of R2S All: " << rs_total_nall << " ====== " << std::endl;
715  std::cout << " ====== Total Number of R2S SecondaryVertex: " << rs_total_nsv << " ====== " << std::endl;
716  std::cout << " ====== Total Number of R2S BWeakDecay: " << rs_total_nbv << " ====== " << std::endl;
717  std::cout << " ====== Total Number of R2S BWeakDecay::SecondaryVertex: " << rs_total_nbsv << " ====== " << std::endl;
718  std::cout << " ====== Total Number of R2S CWeakDecay: " << rs_total_ncv << " ====== " << std::endl;
719  std::cout << " ====== Total Number of R2S Light: " << rs_total_nlv << " ====== " << std::endl;
720  std::cout << std::endl;
721  std::cout << " ====== Total Number of S2R All: " << sr_total_nall << " ====== " << std::endl;
722  std::cout << " ====== Total Number of S2R SecondaryVertex: " << sr_total_nsv << " ====== " << std::endl;
723  std::cout << " ====== Total Number of S2R BWeakDecay: " << sr_total_nbv << " ====== " << std::endl;
724  std::cout << " ====== Total Number of S2R BWeakDecay::SecondaryVertex: " << sr_total_nbsv << " ====== " << std::endl;
725  std::cout << " ====== Total Number of S2R CWeakDecay: " << sr_total_ncv << " ====== " << std::endl;
726  std::cout << " ====== Total Number of S2R Light: " << sr_total_nlv << " ====== " << std::endl;
727  std::cout << std::endl;
728  std::cout << " ====== Total Number of Fake Vertices: " << total_nfake << " ====== " << std::endl;
729 
730 }
tuple cout
Definition: gather_cfg.py:121
void recoBSVTagInfoValidationAnalyzer::fillRecoToSim ( std::string const &  prefix,
reco::Vertex const &  vertex,
TrackingVertexRef const &  simVertex 
)
private

Definition at line 527 of file recoBSVTagInfoValidationAnalyzer.cc.

References RecoTauCleanerPlugins::charge, reco::Vertex::chi2(), ChiSquaredProbability(), eta, HistIndex_, reco::Vertex::ndof(), reco::Vertex::normalizedChi2(), AlCaHLTBitMon_ParallelJobs::p, EnergyCorrector::pt, mathSSE::sqrt(), reco::Vertex::tracks_begin(), reco::Vertex::tracks_end(), reco::Vertex::tracksSize(), reco::Vertex::trackWeight(), puppiForMET_cff::weight, reco::Vertex::x(), reco::Vertex::xError(), reco::Vertex::y(), reco::Vertex::yError(), reco::Vertex::z(), and reco::Vertex::zError().

Referenced by analyze().

528 {
529 
530  double pullx = (vertex.x() - simVertex->position().x())/vertex.xError();
531  double pully = (vertex.y() - simVertex->position().y())/vertex.yError();
532  double pullz = (vertex.z() - simVertex->position().z())/vertex.zError();
533 
534  double resx = vertex.x() - simVertex->position().x();
535  double resy = vertex.y() - simVertex->position().y();
536  double resz = vertex.z() - simVertex->position().z();
537 
538  double chi2norm = vertex.normalizedChi2();
539  double chi2prob = ChiSquaredProbability( vertex.chi2(), vertex.ndof() );
540 
541  double sum_weight = 0.;
542  double weight = 0.;
543  double tracksize = vertex.tracksSize();
544  math::XYZVector momentum;
546  int charge = 0;
547  double thePiMass = 0.13957;
548  for ( reco::Vertex::trackRef_iterator recDaughter = vertex.tracks_begin() ; recDaughter != vertex.tracks_end(); ++recDaughter) {
549 
550  ROOT::Math::LorentzVector<ROOT::Math::PxPyPzM4D<double> > vec;
551 
552  vec.SetPx( (**recDaughter).px() );
553  vec.SetPy( (**recDaughter).py() );
554  vec.SetPz( (**recDaughter).pz() );
555  vec.SetM(thePiMass);
556 
557  sum += vec;
558 
559  weight = vertex.trackWeight(*recDaughter);
560  sum_weight += weight;
561 
563  p = (**recDaughter).momentum();
564  momentum += p;
565 
566  charge += (*recDaughter)->charge();
567 
568  HistIndex_[prefix + "_RecTrackPt"]->Fill( (*recDaughter)->pt() );
569  HistIndex_[prefix + "_RecTrackEta"]->Fill( (*recDaughter)->eta() );
570  }//end loop to recDaughters
571  //cout << " average sum of weights = " << sum_weight/tracksize << endl;
572 
573  double mass = sum.M();
574  double pt = sqrt( momentum.Perp2() );
575  double eta = momentum.Eta();
576 
577  math::XYZVector simmomentum;
578  int simcharge = 0;
579  for ( TrackingVertex::tp_iterator simDaughter = simVertex->daughterTracks_begin(); simDaughter != simVertex->daughterTracks_end(); ++simDaughter ){
580 
582  p = (**simDaughter).momentum();
583  simmomentum += p;
584 
585  simcharge += (*simDaughter)->charge();
586 
587  HistIndex_[prefix + "_SimTrackPt"]->Fill( (*simDaughter)->pt() );
588  HistIndex_[prefix + "_SimTrackEta"]->Fill( (*simDaughter)->eta() );
589  }
590 
591  double simpt = sqrt( simmomentum.Perp2() );
592  double simeta = simmomentum.Eta();
593 
594  //cout << "[fillRecoToSim] vertex.tracksSize() = " << vertex.tracksSize() << " ; simVertex->nDaughterTracks() = " << simVertex->nDaughterTracks() << endl;
595 
596  HistIndex_[prefix + "_nRecTrks"]->Fill( vertex.tracksSize() );
597  HistIndex_[prefix + "_nSimTrks"]->Fill( simVertex->nDaughterTracks() );
598  HistIndex_[prefix + "_Pullx"]->Fill(pullx);
599  HistIndex_[prefix + "_Pully"]->Fill(pully);
600  HistIndex_[prefix + "_Pullz"]->Fill(pullz);
601  HistIndex_[prefix + "_Resx"]->Fill(resx);
602  HistIndex_[prefix + "_Resy"]->Fill(resy);
603  HistIndex_[prefix + "_Resz"]->Fill(resz);
604  HistIndex_[prefix + "_AverageTrackWeight"]->Fill( sum_weight/tracksize );
605  HistIndex_[prefix + "_Chi2Norm"]->Fill(chi2norm);
606  HistIndex_[prefix + "_Chi2Prob"]->Fill(chi2prob);
607  HistIndex_[prefix + "_RecPt"]->Fill(pt);
608  HistIndex_[prefix + "_RecEta"]->Fill(eta);
609  HistIndex_[prefix + "_RecCharge"]->Fill(charge);
610  HistIndex_[prefix + "_Mass"]->Fill(mass);
611  HistIndex_[prefix + "_SimPt"]->Fill(simpt);
612  HistIndex_[prefix + "_SimEta"]->Fill(simeta);
613  HistIndex_[prefix + "_SimCharge"]->Fill(simcharge);
614 }
XYZTLorentzVectorD XYZTLorentzVector
Lorentz vector with cylindrical internal representation using pseudorapidity.
Definition: LorentzVector.h:29
T sqrt(T t)
Definition: SSEVec.h:48
std::map< std::string, MonitorElement * > HistIndex_
float ChiSquaredProbability(double chiSquared, double nrDOF)
XYZVectorD XYZVector
spatial vector with cartesian internal representation
Definition: Vector3D.h:30
std::vector< TrackBaseRef >::const_iterator trackRef_iterator
The iteratator for the vector&lt;TrackRef&gt;
Definition: Vertex.h:37
void recoBSVTagInfoValidationAnalyzer::fillSimToReco ( std::string const &  prefix,
reco::VertexBaseRef const &  vertex,
TrackingVertexRef const &  simVertex 
)
private

Definition at line 617 of file recoBSVTagInfoValidationAnalyzer.cc.

References RecoTauCleanerPlugins::charge, reco::Vertex::chi2(), ChiSquaredProbability(), eta, HistIndex_, reco::Vertex::ndof(), reco::Vertex::normalizedChi2(), AlCaHLTBitMon_ParallelJobs::p, EnergyCorrector::pt, mathSSE::sqrt(), reco::Vertex::tracks_begin(), reco::Vertex::tracks_end(), reco::Vertex::tracksSize(), reco::Vertex::trackWeight(), puppiForMET_cff::weight, reco::Vertex::x(), reco::Vertex::xError(), reco::Vertex::y(), reco::Vertex::yError(), reco::Vertex::z(), and reco::Vertex::zError().

Referenced by analyze().

618 {
619 
620  double pullx = (vertex->x() - simVertex->position().x())/vertex->xError();
621  double pully = (vertex->y() - simVertex->position().y())/vertex->yError();
622  double pullz = (vertex->z() - simVertex->position().z())/vertex->zError();
623 
624  double resx = vertex->x() - simVertex->position().x();
625  double resy = vertex->y() - simVertex->position().y();
626  double resz = vertex->z() - simVertex->position().z();
627 
628  double chi2norm = vertex->normalizedChi2();
629  double chi2prob = ChiSquaredProbability(vertex->chi2(), vertex->ndof());
630 
631  double sum_weight = 0.;
632  double weight = 0.;
633  double tracksize = vertex->tracksSize();
634  math::XYZVector momentum;
636  int charge = 0;
637  double thePiMass = 0.13957;
638  for ( reco::Vertex::trackRef_iterator recDaughter = vertex->tracks_begin() ; recDaughter != vertex->tracks_end(); ++recDaughter ) {
639 
640  ROOT::Math::LorentzVector<ROOT::Math::PxPyPzM4D<double> > vec;
641 
642  vec.SetPx( (**recDaughter).px() );
643  vec.SetPy( (**recDaughter).py() );
644  vec.SetPz( (**recDaughter).pz() );
645  vec.SetM(thePiMass);
646 
647  sum += vec;
648 
649  weight = vertex->trackWeight(*recDaughter);
650  sum_weight += weight;
651 
653  p = (**recDaughter).momentum();
654  momentum += p;
655 
656  charge += (*recDaughter)->charge();
657 
658  HistIndex_[prefix + "_RecTrackPt"]->Fill( (*recDaughter)->pt() );
659  HistIndex_[prefix + "_RecTrackEta"]->Fill( (*recDaughter)->eta() );
660 
661  }
662  //cout << " average sum of weights = " << sum_weight/tracksize << endl;
663 
664  double mass = sum.M();
665  double pt = sqrt( momentum.Perp2() );
666  double eta = momentum.Eta();
667 
668  math::XYZVector simmomentum;
669  int simcharge = 0;
670  for ( TrackingVertex::tp_iterator simDaughter = simVertex->daughterTracks_begin(); simDaughter != simVertex->daughterTracks_end(); ++simDaughter ){
671 
673  p = (**simDaughter).momentum();
674  simmomentum += p;
675 
676  simcharge += (*simDaughter)->charge();
677 
678  HistIndex_[prefix + "_SimTrackPt"]->Fill( (*simDaughter)->pt() );
679  HistIndex_[prefix + "_SimTrackEta"]->Fill( (*simDaughter)->eta() );
680  }
681 
682  double simpt = sqrt( simmomentum.Perp2() );
683  double simeta = simmomentum.Eta();
684 
685  //cout << "[fillSimToReco] vertex->tracksSize() = " << vertex->tracksSize() << " ; simVertex->nDaughterTracks() = " << simVertex->nDaughterTracks() << endl;
686 
687  HistIndex_[prefix + "_nRecTrks"]->Fill( vertex->tracksSize() );
688  HistIndex_[prefix + "_nSimTrks"]->Fill( simVertex->nDaughterTracks() );
689  HistIndex_[prefix + "_Pullx"]->Fill(pullx);
690  HistIndex_[prefix + "_Pully"]->Fill(pully);
691  HistIndex_[prefix + "_Pullz"]->Fill(pullz);
692  HistIndex_[prefix + "_Resx"]->Fill(resx);
693  HistIndex_[prefix + "_Resy"]->Fill(resy);
694  HistIndex_[prefix + "_Resz"]->Fill(resz);
695  HistIndex_[prefix + "_AverageTrackWeight"]->Fill( sum_weight/tracksize );
696  HistIndex_[prefix + "_Chi2Norm"]->Fill(chi2norm);
697  HistIndex_[prefix + "_Chi2Prob"]->Fill(chi2prob);
698  HistIndex_[prefix + "_RecPt"]->Fill(pt);
699  HistIndex_[prefix + "_RecEta"]->Fill(eta);
700  HistIndex_[prefix + "_RecCharge"]->Fill(charge);
701  HistIndex_[prefix + "_Mass"]->Fill(mass);
702  HistIndex_[prefix + "_SimPt"]->Fill(simpt);
703  HistIndex_[prefix + "_SimEta"]->Fill(simeta);
704  HistIndex_[prefix + "_SimCharge"]->Fill(simcharge);
705 
706 }
XYZTLorentzVectorD XYZTLorentzVector
Lorentz vector with cylindrical internal representation using pseudorapidity.
Definition: LorentzVector.h:29
T sqrt(T t)
Definition: SSEVec.h:48
std::map< std::string, MonitorElement * > HistIndex_
float ChiSquaredProbability(double chiSquared, double nrDOF)
XYZVectorD XYZVector
spatial vector with cartesian internal representation
Definition: Vector3D.h:30
std::vector< TrackBaseRef >::const_iterator trackRef_iterator
The iteratator for the vector&lt;TrackRef&gt;
Definition: Vertex.h:37

Member Data Documentation

VertexClassifierByProxy<reco::SecondaryVertexTagInfoCollection> recoBSVTagInfoValidationAnalyzer::classifier_
private

Definition at line 50 of file recoBSVTagInfoValidationAnalyzer.cc.

Referenced by analyze().

std::string recoBSVTagInfoValidationAnalyzer::dqmLabel
private
DQMStore* recoBSVTagInfoValidationAnalyzer::dqmStore_
private
std::map<std::string, MonitorElement *> recoBSVTagInfoValidationAnalyzer::HistIndex_
private
Int_t recoBSVTagInfoValidationAnalyzer::n_event
private
Int_t recoBSVTagInfoValidationAnalyzer::numberVertexClassifier_
private
Int_t recoBSVTagInfoValidationAnalyzer::rs_total_nall
private
Int_t recoBSVTagInfoValidationAnalyzer::rs_total_nbsv
private
Int_t recoBSVTagInfoValidationAnalyzer::rs_total_nbv
private
Int_t recoBSVTagInfoValidationAnalyzer::rs_total_ncv
private
Int_t recoBSVTagInfoValidationAnalyzer::rs_total_nlv
private
Int_t recoBSVTagInfoValidationAnalyzer::rs_total_nsv
private
Int_t recoBSVTagInfoValidationAnalyzer::sr_total_nall
private
Int_t recoBSVTagInfoValidationAnalyzer::sr_total_nbsv
private
Int_t recoBSVTagInfoValidationAnalyzer::sr_total_nbv
private
Int_t recoBSVTagInfoValidationAnalyzer::sr_total_ncv
private
Int_t recoBSVTagInfoValidationAnalyzer::sr_total_nlv
private
Int_t recoBSVTagInfoValidationAnalyzer::sr_total_nsv
private
edm::EDGetTokenT<reco::SecondaryVertexTagInfoCollection> recoBSVTagInfoValidationAnalyzer::svInfoToken
private
edm::InputTag recoBSVTagInfoValidationAnalyzer::svTagInfoProducer_
private

Definition at line 54 of file recoBSVTagInfoValidationAnalyzer.cc.

Int_t recoBSVTagInfoValidationAnalyzer::total_nfake
private
Int_t recoBSVTagInfoValidationAnalyzer::total_nmiss
private
edm::InputTag recoBSVTagInfoValidationAnalyzer::trackingTruth_
private

Definition at line 53 of file recoBSVTagInfoValidationAnalyzer.cc.

edm::EDGetTokenT<TrackingVertexCollection> recoBSVTagInfoValidationAnalyzer::tvToken
private