CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
HLTHiggsSubAnalysis.cc
Go to the documentation of this file.
1 
9 
11 
15 
17 
18 #include "TPRegexp.h"
19 #include "TString.h"
20 
23 
26 
27 #include "TPRegexp.h"
28 #include "TString.h"
29 
30 #include<set>
31 #include<algorithm>
32 
33 
35  const std::string & analysisname) :
36  _pset(pset),
37  _analysisname(analysisname),
38  _minCandidates(0),
39  _hltProcessName(pset.getParameter<std::string>("hltProcessName")),
40  _genParticleLabel(pset.getParameter<std::string>("genParticleLabel")),
41  _parametersEta(pset.getParameter<std::vector<double> >("parametersEta")),
42  _parametersPhi(pset.getParameter<std::vector<double> >("parametersPhi")),
43  _parametersTurnOn(pset.getParameter<std::vector<double> >("parametersTurnOn")),
44  _recMuonSelector(0),
45  _recElecSelector(0),
46  _recCaloMETSelector(0),
47  _recPFTauSelector(0),
48  _recPhotonSelector(0),
49  _recTrackSelector(0),
50  _dbe(0)
51 {
52  // Specific parameters for this analysis
53  edm::ParameterSet anpset = pset.getParameter<edm::ParameterSet>(analysisname);
54  // Collections labels (but genparticles already initialized)
55  // initializing _recLabels data member)
56  this->bookobjects( anpset );
57 
58  // Generic objects: Initialization of cuts
59  for(std::map<unsigned int,std::string>::const_iterator it = _recLabels.begin();
60  it != _recLabels.end(); ++it)
61  {
62  const std::string objStr = EVTColContainer::getTypeString(it->first);
63  _genCut[it->first] = pset.getParameter<std::string>( std::string(objStr+"_genCut").c_str() );
64  _recCut[it->first] = pset.getParameter<std::string>( std::string(objStr+"_recCut").c_str() );
65  _cutMinPt[it->first] = pset.getParameter<double>( std::string(objStr+"_cutMinPt").c_str() );
66  _cutMaxEta[it->first] = pset.getParameter<double>( std::string(objStr+"_cutMaxEta").c_str() );
67  }
68 
69  //--- Updating parameters if has to be modified for this particular specific analysis
70  for(std::map<unsigned int,std::string>::const_iterator it = _recLabels.begin();
71  it != _recLabels.end(); ++it)
72  {
73  const std::string objStr = EVTColContainer::getTypeString(it->first);
74  try
75  {
76  _genCut[it->first] = anpset.getUntrackedParameter<std::string>( std::string(objStr+"_genCut").c_str() );
77  }
78  catch(edm::Exception)
79  {
80  }
81  try
82  {
83  _recCut[it->first] = anpset.getUntrackedParameter<std::string>( std::string(objStr+"_recCut").c_str() );
84  }
85  catch(edm::Exception)
86  {
87  }
88  try
89  {
90  _cutMinPt[it->first] = anpset.getUntrackedParameter<double>( std::string(objStr+"_cutMinPt").c_str() );
91  }
92  catch(edm::Exception)
93  {
94  }
95  try
96  {
97  _cutMaxEta[it->first] = anpset.getUntrackedParameter<double>( std::string(objStr+"_cutMaxEta").c_str() );
98  }
99  catch(edm::Exception)
100  {
101  }
102  }
103 
104  _hltPathsToCheck = anpset.getParameter<std::vector<std::string> >("hltPathsToCheck");
105  _minCandidates = anpset.getParameter<unsigned int>("minCandidates");
106 
108  _dbe->setVerbose(0);
109 }
110 
112 {
113  for(std::map<unsigned int,StringCutObjectSelector<reco::GenParticle>* >::iterator it = _genSelectorMap.begin();
114  it != _genSelectorMap.end(); ++it)
115  {
116  if( it->second != 0)
117  {
118  delete it->second;
119  it->second =0;
120  }
121  }
122  if( _recMuonSelector != 0)
123  {
124  delete _recMuonSelector;
125  _recMuonSelector =0;
126  }
127  if( _recElecSelector != 0)
128  {
129  delete _recElecSelector;
130  _recElecSelector =0;
131  }
132  if( _recPhotonSelector != 0)
133  {
134  delete _recPhotonSelector;
136  }
137  if( _recCaloMETSelector != 0)
138  {
139  delete _recCaloMETSelector;
141  }
142  if( _recPFTauSelector != 0)
143  {
144  delete _recPFTauSelector;
146  }
147  if( _recTrackSelector != 0)
148  {
149  delete _recTrackSelector;
151  }
152 }
153 
154 
156 {
157 }
158 
159 
160 
161 void HLTHiggsSubAnalysis::beginRun(const edm::Run & iRun, const edm::EventSetup & iSetup)
162 {
163  std::string baseDir = "HLT/Higgs/"+_analysisname+"/";
164  _dbe->setCurrentFolder(baseDir);
165 
166  // Initialize the confighlt
167  bool changedConfig;
168  if(!_hltConfig.init(iRun,iSetup,_hltProcessName,changedConfig))
169  {
170  edm::LogError("HiggsValidations") << "HLTHiggsSubAnalysis::beginRun: "
171  << "Initializtion of HLTConfigProvider failed!!";
172  }
173 
174 
175  // Parse the input paths to get them if there are in the table
176  // and associate them the last filter of the path (in order to extract the
177  _hltPaths.clear();
178  for(size_t i = 0; i < _hltPathsToCheck.size(); ++i)
179  {
180  bool found = false;
181  TPRegexp pattern(_hltPathsToCheck[i]);
182  for(size_t j = 0 ; j < _hltConfig.triggerNames().size(); ++j)
183  {
184  std::string thetriggername = _hltConfig.triggerNames()[j];
185  if(TString(thetriggername).Contains(pattern))
186  {
187  _hltPaths.insert(thetriggername);
188  found = true;
189  }
190  }
191  if( ! found )
192  {
193  edm::LogWarning("HiggsValidations") << "HLTHiggsSubAnalysis::beginRun, In "
194  << _analysisname << " subfolder NOT found the path: '"
195  << _hltPathsToCheck[i] << "*'" ;
196  }
197  }
198 
199  LogTrace("HiggsValidation") << "SubAnalysis: " << _analysisname
200  << "\nHLT Trigger Paths found >>>";
201  // Initialize the plotters (analysers for each trigger path)
202  _analyzers.clear();
203  for(std::set<std::string>::iterator iPath = _hltPaths.begin();
204  iPath != _hltPaths.end(); ++iPath)
205  {
206  // Avoiding the dependence of the version number for
207  // the trigger paths
208  std::string path = * iPath;
209  std::string shortpath = path;
210  if(path.rfind("_v") < path.length())
211  {
212  shortpath = path.substr(0, path.rfind("_v"));
213  }
214  _shortpath2long[shortpath] = path;
215 
216  // Objects needed by the HLT path
217  const std::vector<unsigned int> objsNeedHLT = this->getObjectsType(shortpath);
218  // Sanity check: the object needed by a trigger path should be
219  // introduced by the user via config python (_recLabels datamember)
220  std::vector<unsigned int> userInstantiate;
221  for(std::map<unsigned int,std::string>::iterator it = _recLabels.begin() ;
222  it != _recLabels.end(); ++it)
223  {
224  userInstantiate.push_back(it->first);
225  }
226  for(std::vector<unsigned int>::const_iterator it = objsNeedHLT.begin(); it != objsNeedHLT.end();
227  ++it)
228  {
229  if( std::find(userInstantiate.begin(),userInstantiate.end(), *it) ==
230  userInstantiate.end() )
231  {
232  edm::LogError("HiggsValidation") << "In HLTHiggsSubAnalysis::beginRun, "
233  << "Incoherence found in the python configuration file!!\nThe SubAnalysis '"
234  << _analysisname << "' has been asked to evaluate the trigger path '"
235  << shortpath << "' (found it in 'hltPathsToCheck') BUT this path"
236  << " needs a '" << EVTColContainer::getTypeString(*it)
237  << "' which has not been instantiate ('recVariableLabels'"
238  << ")" ;
239  exit(-1);
240  }
241  }
242  LogTrace("HiggsValidation") << " --- " << shortpath;
243 
244  // the hlt path, the objects (elec,muons,photons,...)
245  // needed to evaluate the path are the argumens of the plotter
246  HLTHiggsPlotter analyzer(_pset, shortpath,objsNeedHLT, _dbe);
247  _analyzers.push_back(analyzer);
248  }
249 
250  // Call the beginRun (which books all the path dependent histograms)
251  for(std::vector<HLTHiggsPlotter>::iterator it = _analyzers.begin();
252  it != _analyzers.end(); ++it)
253  {
254  it->beginRun(iRun, iSetup);
255  }
256 
257  // Book the gen/reco analysis-dependent histograms (denominators)
258  for(std::map<unsigned int,std::string>::const_iterator it = _recLabels.begin();
259  it != _recLabels.end(); ++it)
260  {
261  const std::string objStr = EVTColContainer::getTypeString(it->first);
262  std::vector<std::string> sources(2);
263  sources[0] = "gen";
264  sources[1] = "rec";
265 
266  for(size_t i = 0; i < sources.size(); i++)
267  {
268  std::string source = sources[i];
269  bookHist(source, objStr, "Eta");
270  bookHist(source, objStr, "Phi");
271  bookHist(source, objStr, "MaxPt1");
272  bookHist(source, objStr, "MaxPt2");
273  }
274  }
275 }
276 
277 
278 
280  EVTColContainer * cols)
281 {
282  // Initialize the collection (the ones which hasn't been initialiazed yet)
283  this->initobjects(iEvent,cols);
284  // utility map
285  std::map<unsigned int,std::string> u2str;
286  u2str[GEN]="gen";
287  u2str[RECO]="rec";
288 
289  // Extract the match structure containing the gen/reco candidates (electron, muons,...)
290  // common to all the SubAnalysis
291  //---- Generation
292  // Make each good gen object into the base cand for a MatchStruct
293  std::vector<MatchStruct> * matches = new std::vector<MatchStruct>;
294 // bool alreadyMu = false;
295  for(std::map<unsigned int,std::string>::iterator it = _recLabels.begin();
296  it != _recLabels.end(); ++it)
297  {
298  // Avoiding the TkMu and Mu case
299 /* if( alreadyMu )
300  {
301  continue;
302  }*/
303  // Initialize selectors when first event
304  if(!_genSelectorMap[it->first])
305  {
307  }
308 
309  for(size_t i = 0; i < cols->genParticles->size(); ++i)
310  {
311  if(_genSelectorMap[it->first]->operator()(cols->genParticles->at(i)))
312  {
313  matches->push_back(MatchStruct(&cols->genParticles->at(i),it->first));
314  }
315  }
316 /* if( it->first == EVTColContainer::MUON || it->first == EVTColContainer::TRACK )
317  {
318  alreadyMu = true;
319  }*/
320  }
321  // Sort the MatchStructs by pT for later filling of turn-on curve
322  std::sort(matches->begin(), matches->end(), matchesByDescendingPt());
323 
324  // Map to reference the source (gen/reco) with the recoCandidates
325  std::map<unsigned int,std::vector<MatchStruct> > sourceMatchMap; // To be a pointer to delete
326  // --- Storing the generating candidates
327  sourceMatchMap[GEN] = *matches;
328 
329  // Reuse the vector
330  matches->clear();
331  // --- same for RECO objects
332  // Extraction of the objects candidates
333  for(std::map<unsigned int,std::string>::iterator it = _recLabels.begin();
334  it != _recLabels.end(); ++it)
335  {
336  // Reco selectors (the function takes into account if it was instantiated
337  // before or not
338  this->InitSelector(it->first);
339  // -- Storing the matches
340  this->insertcandidates(it->first,cols,matches);
341  }
342  // Sort the MatchStructs by pT for later filling of turn-on curve
343  std::sort(matches->begin(), matches->end(), matchesByDescendingPt());
344  // --- Storing the reco candidates
345  sourceMatchMap[RECO] = *matches;
346  // --- All the objects are in place
347  delete matches;
348 
349  // -- Trigger Results
350  const edm::TriggerNames trigNames = iEvent.triggerNames(*(cols->triggerResults));
351 
352  // Filling the histograms if pass the minimum amount of candidates needed by the analysis:
353  // GEN + RECO CASE in the same loop
354  for(std::map<unsigned int,std::vector<MatchStruct> >::iterator it = sourceMatchMap.begin();
355  it != sourceMatchMap.end(); ++it)
356  {
357  // it->first: gen/reco it->second: matches (std::vector<MatchStruc>)
358  if( it->second.size() < _minCandidates ) // FIXME: A bug is potentially here: what about the mixed channels?
359  {
360  continue;
361  }
362 
363  // Filling the gen/reco objects (eff-denominators):
364  // Just the first two different ones, if there are more
365  std::map<unsigned int,int> * countobjects = new std::map<unsigned int,int>;
366  // Initializing the count of the used object
367  for(std::map<unsigned int,std::string>::iterator co = _recLabels.begin();
368  co != _recLabels.end(); ++co)
369  {
370  countobjects->insert(std::pair<unsigned int,int>(co->first,0));
371  }
372  int counttotal = 0;
373  const int totalobjectssize2 = 2*countobjects->size();
374  for(size_t j = 0; j < it->second.size(); ++j)
375  {
376  const unsigned int objType = it->second[j].objType;
377  const std::string objTypeStr = EVTColContainer::getTypeString(objType);
378 
379  float pt = (it->second)[j].pt;
380  float eta = (it->second)[j].eta;
381  float phi = (it->second)[j].phi;
382 
383  this->fillHist(u2str[it->first],objTypeStr,"Eta",eta);
384  this->fillHist(u2str[it->first],objTypeStr,"Phi",phi);
385  if( (*countobjects)[objType] == 0 )
386  {
387  this->fillHist(u2str[it->first],objTypeStr,"MaxPt1",pt);
388  // Filled the high pt ...
389  ++((*countobjects)[objType]);
390  ++counttotal;
391  }
392  else if( (*countobjects)[objType] == 1 )
393  {
394  this->fillHist(u2str[it->first],objTypeStr,"MaxPt2",pt);
395  // Filled the second high pt ...
396  ++((*countobjects)[objType]);
397  ++counttotal;
398  }
399  else
400  {
401  // Already the minimum two objects has been filled, get out...
402  if( counttotal == totalobjectssize2 )
403  {
404  break;
405  }
406  }
407  }
408  delete countobjects;
409 
410  // Calling to the plotters analysis (where the evaluation of the different trigger paths are done)
411  const std::string source = u2str[it->first];
412  for(std::vector<HLTHiggsPlotter>::iterator an = _analyzers.begin();
413  an != _analyzers.end(); ++an)
414  {
415  const std::string hltPath = _shortpath2long[an->gethltpath()];
416  const bool ispassTrigger = cols->triggerResults->accept(trigNames.triggerIndex(hltPath));
417  an->analyze(ispassTrigger,source,it->second);
418  }
419  }
420 }
421 
422 // Return the objects (muons,electrons,photons,...) needed by a hlt path.
423 const std::vector<unsigned int> HLTHiggsSubAnalysis::getObjectsType(const std::string & hltPath) const
424 {
425  static const unsigned int objSize = 5; //6;
426  static const unsigned int objtriggernames[] = { EVTColContainer::MUON,
429 // EVTColContainer::TRACK, // Note is tracker muon
432  };
433 
434  std::set<unsigned int> objsType;
435  // The object to deal has to be entered via the config .py
436  for(unsigned int i = 0; i < objSize; ++i)
437  {
438  std::string objTypeStr = EVTColContainer::getTypeString( objtriggernames[i] );
439  // Check if it is needed this object for this trigger
440  if( ! TString(hltPath).Contains(objTypeStr) )
441  {
442  continue;
443  }
444 
445  objsType.insert(objtriggernames[i]);
446  }
447 
448  return std::vector<unsigned int>(objsType.begin(),objsType.end());
449 }
450 
451 
452 // Booking the maps: recLabels and genParticle selectors
454 {
455  if( anpset.exists("recMuonLabel") )
456  {
457  _recLabels[EVTColContainer::MUON] = anpset.getParameter<std::string>("recMuonLabel");
459  }
460  if( anpset.exists("recElecLabel") )
461  {
462  _recLabels[EVTColContainer::ELEC] = anpset.getParameter<std::string>("recElecLabel");
464  }
465  if( anpset.exists("recPhotonLabel") )
466  {
467  _recLabels[EVTColContainer::PHOTON] = anpset.getParameter<std::string>("recPhotonLabel");
469  }
470  if( anpset.exists("recCaloMETLabel") )
471  {
472  _recLabels[EVTColContainer::CALOMET] = anpset.getParameter<std::string>("recCaloMETLabel");
474  }
475  if( anpset.exists("recPFTauLabel") )
476  {
477  _recLabels[EVTColContainer::PFTAU] = anpset.getParameter<std::string>("recPFTauLabel");
479  }
480  /*if( anpset.exists("recTrackLabel") )
481  {
482  _recLabels[EVTColContainer::TRACK] = anpset.getParameter<std::string>("recTrackLabel");
483  _genSelectorMap[EVTColContainer::TRACK] = 0 ;
484  }*/
485 
486  if( _recLabels.size() < 1 )
487  {
488  edm::LogError("HiggsValidation") << "HLTHiggsSubAnalysis::bookobjects, "
489  << "Not included any object (recMuonLabel, recElecLabel, ...) "
490  << "in the analysis " << _analysisname;
491  return;
492  }
493 }
494 
496 {
497  /*if( col != 0 && col->isAllInit() )
498  {
499  // Already init, not needed to do nothing
500  return;
501  }*/
502  if( ! col->isCommonInit() )
503  {
504  // TO BE DEPRECATED AS we don't need it anymore.
505  // There is no match with HLT candidates... Use, then TriggerResults
506  /*edm::Handle<trigger::TriggerEventWithRefs> rawTEH;
507  iEvent.getByLabel("hltTriggerSummaryRAW",rawTEH);
508  if(rawTEH.failedToGet())
509  {
510  edm::LogError("HiggsValidation") << "HLTHiggsSubAnalysis::initobjecst, "
511  << "No trigger summary found";
512  return;
513  }
514  col->rawTriggerEvent = rawTEH.product();*/
515  // END-- TO BE DEPRECATED
516 
517  // extract the trigger results (path info, pass,...)
519  edm::InputTag trigResultsTag("TriggerResults","",_hltProcessName);
520  iEvent.getByLabel(trigResultsTag,trigResults);
521  if( trigResults.isValid() )
522  {
523  col->triggerResults = trigResults.product();
524  }
525 
526  // GenParticle collection if is there
528  iEvent.getByLabel(_genParticleLabel,genPart);
529  if( genPart.isValid() )
530  {
531  col->genParticles = genPart.product();
532  }
533  }
534 
535  for(std::map<unsigned int,std::string>::iterator it = _recLabels.begin();
536  it != _recLabels.end(); ++it)
537  {
538  if( it->first == EVTColContainer::MUON )
539  {
541  iEvent.getByLabel(it->second, theHandle);
542  col->set(theHandle.product());
543  }
544  else if( it->first == EVTColContainer::ELEC )
545  {
547  iEvent.getByLabel(it->second, theHandle);
548  col->set(theHandle.product());
549  }
550  else if( it->first == EVTColContainer::PHOTON )
551  {
553  iEvent.getByLabel(it->second, theHandle);
554  col->set(theHandle.product());
555  }
556  else if( it->first == EVTColContainer::CALOMET )
557  {
559  iEvent.getByLabel(it->second, theHandle);
560  col->set(theHandle.product());
561  }
562  else if( it->first == EVTColContainer::PFTAU )
563  {
565  iEvent.getByLabel(it->second, theHandle);
566  col->set(theHandle.product());
567  }
568 /* else if( it->first == EVTColContainer::TRACK )
569  {
570  edm::Handle<reco::TrackCollection> theHandle;
571  iEvent.getByLabel(it->second, theHandle);
572  col->set(theHandle.product());
573  }*/
574  else
575  {
576  edm::LogError("HiggsValidation") << "HLTHiggsSubAnalysis::initobjects "
577  << " NOT IMPLEMENTED (yet) ERROR: '" << it->second << "'";
578  //return; ??
579  }
580  }
581 }
582 
583 void HLTHiggsSubAnalysis::bookHist(const std::string & source,
584  const std::string & objType, const std::string & variable)
585 {
586  std::string sourceUpper = source;
587  sourceUpper[0] = std::toupper(sourceUpper[0]);
588  std::string name = source + objType + variable ;
589  TH1F * h = 0;
590 
591  if(variable.find("MaxPt") != std::string::npos)
592  {
593  std::string desc = (variable == "MaxPt1") ? "Leading" : "Next-to-Leading";
594  std::string title = "pT of " + desc + " " + sourceUpper + " " + objType;
595  const size_t nBins = _parametersTurnOn.size() - 1;
596  float * edges = new float[nBins + 1];
597  for(size_t i = 0; i < nBins + 1; i++)
598  {
599  edges[i] = _parametersTurnOn[i];
600  }
601  h = new TH1F(name.c_str(), title.c_str(), nBins, edges);
602  delete edges;
603  }
604  else
605  {
606  std::string symbol = (variable == "Eta") ? "#eta" : "#phi";
607  std::string title = symbol + " of " + sourceUpper + " " + objType;
608  std::vector<double> params = (variable == "Eta") ? _parametersEta : _parametersPhi;
609 
610  int nBins = (int)params[0];
611  double min = params[1];
612  double max = params[2];
613  h = new TH1F(name.c_str(), title.c_str(), nBins, min, max);
614  }
615  h->Sumw2();
616  _elements[name] = _dbe->book1D(name, h);
617  delete h;
618 }
619 
620 void HLTHiggsSubAnalysis::fillHist(const std::string & source,
621  const std::string & objType, const std::string & variable, const float & value )
622 {
623  std::string sourceUpper = source;
624  sourceUpper[0] = toupper(sourceUpper[0]);
625  std::string name = source + objType + variable ;
626 
627  _elements[name]->Fill(value);
628 }
629 
630 
631 
632 // Initialize the selectors
633 void HLTHiggsSubAnalysis::InitSelector(const unsigned int & objtype)
634 {
635  if( objtype == EVTColContainer::MUON && _recMuonSelector == 0 )
636  {
638  }
639  else if( objtype == EVTColContainer::ELEC && _recElecSelector == 0)
640  {
642  }
643  else if( objtype == EVTColContainer::PHOTON && _recPhotonSelector == 0)
644  {
646  }
647  else if( objtype == EVTColContainer::CALOMET && _recCaloMETSelector == 0)
648  {
650  }
651  else if( objtype == EVTColContainer::PFTAU && _recPFTauSelector == 0 )
652  {
654  }
655  /*else if( objtype == EVTColContainer::TRACK && _recTrackSelector == 0)
656  {
657  _recTrackSelector = new StringCutObjectSelector<reco::Track>(_recCut[objtype]);
658  }*/
659 /* else
660  {
661 FIXME: ERROR NO IMPLEMENTADO
662  }*/
663 }
664 
665 void HLTHiggsSubAnalysis::insertcandidates(const unsigned int & objType, const EVTColContainer * cols,
666  std::vector<MatchStruct> * matches)
667 {
668  if( objType == EVTColContainer::MUON )
669  {
670  for(size_t i = 0; i < cols->muons->size(); i++)
671  {
672  if(_recMuonSelector->operator()(cols->muons->at(i)))
673  {
674  matches->push_back(MatchStruct(&cols->muons->at(i),objType));
675  }
676  }
677  }
678  else if( objType == EVTColContainer::ELEC )
679  {
680  for(size_t i = 0; i < cols->electrons->size(); i++)
681  {
682  if(_recElecSelector->operator()(cols->electrons->at(i)))
683  {
684  matches->push_back(MatchStruct(&cols->electrons->at(i),objType));
685  }
686  }
687  }
688  else if( objType == EVTColContainer::PHOTON )
689  {
690  for(size_t i = 0; i < cols->photons->size(); i++)
691  {
692  if(_recPhotonSelector->operator()(cols->photons->at(i)))
693  {
694  matches->push_back(MatchStruct(&cols->photons->at(i),objType));
695  }
696  }
697  }
698  else if( objType == EVTColContainer::CALOMET )
699  {
700  for(size_t i = 0; i < cols->caloMETs->size(); i++)
701  {
702  if(_recCaloMETSelector->operator()(cols->caloMETs->at(i)))
703  {
704  matches->push_back(MatchStruct(&cols->caloMETs->at(i),objType));
705  }
706  }
707  }
708  else if( objType == EVTColContainer::PFTAU )
709  {
710  for(size_t i = 0; i < cols->pfTaus->size(); i++)
711  {
712  if(_recPFTauSelector->operator()(cols->pfTaus->at(i)))
713  {
714  matches->push_back(MatchStruct(&cols->pfTaus->at(i),objType));
715  }
716  }
717  }
718  /*else if( objType == EVTColContainer::TRACK )
719  {
720  for(size_t i = 0; i < cols->tracks->size(); i++)
721  {
722  if(_recTrackSelector->operator()(cols->tracks->at(i)))
723  {
724  matches->push_back(MatchStruct(&cols->tracks->at(i),objType));
725  }
726  }
727  }*/
728  /*
729  else FIXME: Control errores
730  {
731  }
732  */
733 }
std::vector< double > _parametersTurnOn
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
int i
Definition: DBlmapReader.cc:9
void InitSelector(const unsigned int &objtype)
virtual edm::TriggerNames const & triggerNames(edm::TriggerResults const &triggerResults) const
Definition: Event.cc:199
std::map< std::string, std::string > _shortpath2long
Relation between the short version of a path.
StringCutObjectSelector< reco::CaloMET > * _recCaloMETSelector
std::map< unsigned int, std::string > _genCut
gen/rec objects cuts
static std::string getTypeString(const unsigned int &objtype)
void initobjects(const edm::Event &iEvent, EVTColContainer *col)
MonitorElement * book1D(const char *name, const char *title, int nchX, double lowX, double highX)
Book 1D histogram.
Definition: DQMStore.cc:717
unsigned int _minCandidates
The minimum number of reco/gen candidates needed by the analysis.
std::map< std::string, MonitorElement * > _elements
bool accept() const
Has at least one path accepted the event?
const std::vector< std::string > & triggerNames() const
names of trigger paths
const std::vector< reco::Photon > * photons
edm::ParameterSet _pset
bool exists(std::string const &parameterName) const
checks if a parameter exists
std::set< std::string > _hltPaths
the hlt paths found in the hltConfig
#define min(a, b)
Definition: mlp_lapack.h:161
const std::vector< reco::CaloMET > * caloMETs
const edm::TriggerResults * triggerResults
container with all the objects needed
Strings::size_type size() const
Definition: TriggerNames.cc:39
T eta() const
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:7
HLTConfigProvider _hltConfig
dictionary edges
const std::vector< reco::GsfElectron > * electrons
StringCutObjectSelector< reco::Track > * _recTrackSelector
std::map< unsigned int, std::string > _recCut
std::map< unsigned int, StringCutObjectSelector< reco::GenParticle > * > _genSelectorMap
void set(const reco::MuonCollection *v)
Setter: multiple overloaded function.
void bookobjects(const edm::ParameterSet &anpset)
list path
Definition: scaleCards.py:51
int iEvent
Definition: GenABIO.cc:243
unsigned int triggerIndex(std::string const &name) const
Definition: TriggerNames.cc:32
const T & max(const T &a, const T &b)
std::vector< HLTHiggsPlotter > _analyzers
int j
Definition: DBlmapReader.cc:9
std::map< unsigned int, std::string > _recLabels
HLTHiggsSubAnalysis(const edm::ParameterSet &pset, const std::string &analysisname)
void analyze(const edm::Event &iEvent, const edm::EventSetup &iEventSetup, EVTColContainer *cols)
std::map< unsigned int, double > _cutMinPt
StringCutObjectSelector< reco::PFTau > * _recPFTauSelector
bool isValid() const
Definition: HandleBase.h:76
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:356
#define LogTrace(id)
void beginRun(const edm::Run &iRun, const edm::EventSetup &iEventSetup)
static const char *const trigNames[]
Definition: EcalDumpRaw.cc:75
const reco::GenParticleCollection * genParticles
The Signals That Services Can Subscribe To This is based on ActivityRegistry h
Helper function to determine trigger accepts.
Definition: Activities.doc:4
StringCutObjectSelector< reco::Muon > * _recMuonSelector
void fillHist(const std::string &source, const std::string &objType, const std::string &variable, const float &value)
bool init(const edm::Run &iRun, const edm::EventSetup &iSetup, const std::string &processName, bool &changed)
d&#39;tor
T const * product() const
Definition: Handle.h:74
Helper structure to order MatchStruct.
Definition: MatchStruct.cc:68
const std::vector< unsigned int > getObjectsType(const std::string &hltpath) const
Extract what objects need this analysis.
void insertcandidates(const unsigned int &objtype, const EVTColContainer *col, std::vector< MatchStruct > *matches)
std::vector< double > _parametersPhi
std::vector< std::string > _hltPathsToCheck
the hlt paths with regular expressions
std::vector< double > _parametersEta
Some kinematical parameters.
std::map< unsigned int, double > _cutMaxEta
StringCutObjectSelector< reco::Photon > * _recPhotonSelector
const std::vector< reco::PFTau > * pfTaus
void bookHist(const std::string &source, const std::string &objType, const std::string &variable)
StringCutObjectSelector< reco::GsfElectron > * _recElecSelector
const std::vector< reco::Muon > * muons
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:429
Definition: Run.h:33
Definition: DDAxes.h:10