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

Public Member Functions

 recoBSVTagInfoValidationAnalyzer (const edm::ParameterSet &)
 
- Public Member Functions inherited from edm::EDAnalyzer
 EDAnalyzer ()
 
std::string workerType () const
 
virtual ~EDAnalyzer ()
 

Private Member Functions

virtual void analyze (const edm::Event &, const edm::EventSetup &)
 
void bookRecoToSim (std::string const &)
 
void bookSimToReco (std::string const &)
 
virtual void endJob ()
 
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::InputTag svTagInfoProducer_
 
Int_t total_nfake
 
Int_t total_nmiss
 
edm::InputTag trackingTruth_
 

Additional Inherited Members

- Public Types inherited from edm::EDAnalyzer
typedef EDAnalyzer ModuleType
 
typedef WorkerT< EDAnalyzerWorkerType
 
- 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::EDAnalyzer
CurrentProcessingContext const * currentContext () const
 

Detailed Description

Definition at line 37 of file recoBSVTagInfoValidationAnalyzer.cc.

Constructor & Destructor Documentation

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

Definition at line 91 of file recoBSVTagInfoValidationAnalyzer.cc.

References DQMStore::book1D(), bookRecoToSim(), bookSimToReco(), dqmLabel, dqmStore_, getTH1F(), edm::ParameterSet::getUntrackedParameter(), 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, DQMStore::setCurrentFolder(), sr_total_nall, sr_total_nbsv, sr_total_nbv, sr_total_ncv, sr_total_nlv, sr_total_nsv, svTagInfoProducer_, total_nfake, total_nmiss, trackingTruth_, and VertexCategories::Unknown.

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

Member Function Documentation

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

Implements edm::EDAnalyzer.

Definition at line 183 of file recoBSVTagInfoValidationAnalyzer.cc.

References VertexCategories::BWeakDecay, classifier_, gather_cfg::cout, VertexCategories::CWeakDecay, VertexClassifierByProxy< Collection >::evaluate(), VertexCategories::Fake, fillRecoToSim(), fillSimToReco(), HistIndex_, VertexClassifier::history(), i, getHLTprescales::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, svTagInfoProducer_, total_nfake, total_nmiss, and trackingTruth_.

184 {
185  ++n_event;
186 
187  std::cout << "*** Analyzing " << event.id() << " n_event = " << n_event << std::endl << std::endl;
188 
189  // Set the classifier for a new event
190  classifier_.newEvent(event, setup);
191 
192 
193  // Vertex collection
195  event.getByLabel(svTagInfoProducer_, svTagInfoCollection);
196 
197  // Get a constant reference to the track history associated to the classifier
198  VertexHistory const & tracer = classifier_.history();
199 
200  cout << "* Event " << n_event << " ; svTagInfoCollection->size() = " << svTagInfoCollection->size() << endl;
201 
202  int rs_nall = 0;
203  int rs_nsv = 0;
204  int rs_nbv = 0;
205  int rs_nbsv = 0;
206  int rs_ncv = 0;
207  int rs_nlv = 0;
208  int nfake = 0;
209 
210  int sr_nall = 0;
211  int sr_nsv = 0;
212  int sr_nbv = 0;
213  int sr_nbsv = 0;
214  int sr_ncv = 0;
215  int sr_nlv = 0;
216  int nmiss = 0;
217 
218  // Loop over the svTagInfo collection.
219  for (std::size_t index = 0; index < svTagInfoCollection->size(); ++index){
220 
221  reco::SecondaryVertexTagInfoRef svTagInfo(svTagInfoCollection, index);
222 
223  // Loop over the vertexes in svTagInfo
224  for ( std::size_t vindex = 0; vindex < svTagInfo->nVertices(); ++vindex ){
225 
226 
227  // Classify the vertices
228  classifier_.evaluate(svTagInfo, vindex);
229 
230  //quality of the match
231  double rs_quality = tracer.quality();
232 
233  // Fill the histogram with the categories
234  for (Int_t i = 0; i != numberVertexClassifier_; ++i) {
235 
237 
238  HistIndex_["VertexClassifier"]->Fill(i);
239  }
240  }
242 
243  HistIndex_["rs_All_MatchQuality"]->Fill( rs_quality );
244  fillRecoToSim("rs_All", svTagInfo->secondaryVertex(vindex), tracer.simVertex());
245  HistIndex_["rs_All_FlightDistance2d"]->Fill( svTagInfo->flightDistance( vindex, true ).value() );
246  rs_nall++;
247 
249 
250  fillRecoToSim("rs_SecondaryVertex", svTagInfo->secondaryVertex(vindex), tracer.simVertex());
251  HistIndex_["rs_SecondaryVertex_FlightDistance2d"]->Fill( svTagInfo->flightDistance( vindex, true ).value() );
252  rs_nsv++;
253  }
254 
256 
257  fillRecoToSim("rs_BWeakDecay", svTagInfo->secondaryVertex(vindex), tracer.simVertex());
258  HistIndex_["rs_BWeakDecay_FlightDistance2d"]->Fill( svTagInfo->flightDistance( vindex, true ).value() );
259  rs_nbv++;
260 
262 
263  fillRecoToSim("rs_BSV", svTagInfo->secondaryVertex(vindex), tracer.simVertex());
264  HistIndex_["rs_BSV_FlightDistance2d"]->Fill( svTagInfo->flightDistance( vindex, true ).value() );
265  rs_nbsv++;
266 
267  }
268  }//BWeakDecay
269 
271 
272  fillRecoToSim("rs_CWeakDecay", svTagInfo->secondaryVertex(vindex), tracer.simVertex());
273  HistIndex_["rs_CWeakDecay_FlightDistance2d"]->Fill( svTagInfo->flightDistance( vindex, true ).value() );
274  rs_ncv++;
275 
276  }
277  else {
278 
279  fillRecoToSim("rs_Light", svTagInfo->secondaryVertex(vindex), tracer.simVertex());
280  HistIndex_["rs_Light_FlightDistance2d"]->Fill( svTagInfo->flightDistance( vindex, true ).value() );
281  rs_nlv++;
282  }
283  }//end if classifier
284 
285  else {
286  cout << " VertexCategories::Fake!!" << endl;
287  nfake++;
288  }
289 
290 
291  }//end loop over vertices in svTagInfo
292 
293  }//loop over svTagInfo
294 
295  HistIndex_["rs_All_nRecVtx"]->Fill( rs_nall );
296  HistIndex_["rs_SecondaryVertex_nRecVtx"]->Fill( rs_nsv );
297  HistIndex_["rs_BWeakDecay_nRecVtx"]->Fill( rs_nbv );
298  HistIndex_["rs_BSV_nRecVtx"]->Fill( rs_nbsv );
299  HistIndex_["rs_CWeakDecay_nRecVtx"]->Fill( rs_ncv );
300  HistIndex_["rs_Light_nRecVtx"]->Fill( rs_nlv );
301  cout << endl;
302 
303  //----------------------------------------------------------------
304  // SIM TO RECO!
305 
306  // Vertex collection
308  event.getByLabel(trackingTruth_, TVCollection);
309 
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:17
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:62
void fillSimToReco(std::string const &, reco::VertexBaseRef const &, TrackingVertexRef const &)
Category
Categories available to vertexes.
VertexClassifierByProxy< reco::SecondaryVertexTagInfoCollection > classifier_
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:68
void fillRecoToSim(std::string const &, reco::Vertex const &, TrackingVertexRef const &)
void recoBSVTagInfoValidationAnalyzer::bookRecoToSim ( std::string const &  prefix)
private

Definition at line 391 of file recoBSVTagInfoValidationAnalyzer.cc.

References DQMStore::book1D(), dqmStore_, HistIndex_, and mergeVDriftHistosByStation::name.

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 }
MonitorElement * book1D(const char *name, const char *title, int nchX, double lowX, double highX)
Book 1D histogram.
Definition: DQMStore.cc:717
std::map< std::string, MonitorElement * > HistIndex_
void recoBSVTagInfoValidationAnalyzer::bookSimToReco ( std::string const &  prefix)
private

Definition at line 459 of file recoBSVTagInfoValidationAnalyzer.cc.

References DQMStore::book1D(), dqmStore_, HistIndex_, and mergeVDriftHistosByStation::name.

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 }
MonitorElement * book1D(const char *name, const char *title, int nchX, double lowX, double highX)
Book 1D histogram.
Definition: DQMStore.cc:717
std::map< std::string, MonitorElement * > HistIndex_
void recoBSVTagInfoValidationAnalyzer::endJob ( void  )
privatevirtual

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 DeDxDiscriminatorTools::charge(), reco::Vertex::chi2(), ChiSquaredProbability(), eta(), HistIndex_, scaleCards::mass, reco::Vertex::ndof(), reco::Vertex::normalizedChi2(), AlCaHLTBitMon_ParallelJobs::p, mathSSE::sqrt(), reco::Vertex::tracks_begin(), reco::Vertex::tracks_end(), reco::Vertex::tracksSize(), reco::Vertex::trackWeight(), CommonMethods::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 }
T eta() const
double charge(const std::vector< uint8_t > &Ampls)
XYZTLorentzVectorD XYZTLorentzVector
Lorentz vector with cylindrical internal representation using pseudorapidity.
Definition: LorentzVector.h:30
T sqrt(T t)
Definition: SSEVec.h:46
std::map< std::string, MonitorElement * > HistIndex_
float ChiSquaredProbability(double chiSquared, double nrDOF)
XYZVectorD XYZVector
spatial vector with cartesian internal representation
Definition: Vector3D.h:31
tuple mass
Definition: scaleCards.py:27
std::vector< TrackBaseRef >::const_iterator trackRef_iterator
The iteratator for the vector&lt;TrackRef&gt;
Definition: Vertex.h:38
void recoBSVTagInfoValidationAnalyzer::fillSimToReco ( std::string const &  prefix,
reco::VertexBaseRef const &  vertex,
TrackingVertexRef const &  simVertex 
)
private

Definition at line 617 of file recoBSVTagInfoValidationAnalyzer.cc.

References DeDxDiscriminatorTools::charge(), reco::Vertex::chi2(), ChiSquaredProbability(), eta(), HistIndex_, scaleCards::mass, reco::Vertex::ndof(), reco::Vertex::normalizedChi2(), AlCaHLTBitMon_ParallelJobs::p, mathSSE::sqrt(), reco::Vertex::tracks_begin(), reco::Vertex::tracks_end(), reco::Vertex::tracksSize(), reco::Vertex::trackWeight(), CommonMethods::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 }
T eta() const
double charge(const std::vector< uint8_t > &Ampls)
XYZTLorentzVectorD XYZTLorentzVector
Lorentz vector with cylindrical internal representation using pseudorapidity.
Definition: LorentzVector.h:30
T sqrt(T t)
Definition: SSEVec.h:46
std::map< std::string, MonitorElement * > HistIndex_
float ChiSquaredProbability(double chiSquared, double nrDOF)
XYZVectorD XYZVector
spatial vector with cartesian internal representation
Definition: Vector3D.h:31
tuple mass
Definition: scaleCards.py:27
std::vector< TrackBaseRef >::const_iterator trackRef_iterator
The iteratator for the vector&lt;TrackRef&gt;
Definition: Vertex.h:38

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::InputTag recoBSVTagInfoValidationAnalyzer::svTagInfoProducer_
private
Int_t recoBSVTagInfoValidationAnalyzer::total_nfake
private
Int_t recoBSVTagInfoValidationAnalyzer::total_nmiss
private
edm::InputTag recoBSVTagInfoValidationAnalyzer::trackingTruth_
private