CMS 3D CMS Logo

EgHLTTrigTools.cc
Go to the documentation of this file.
4 
5 #include <boost/algorithm/string.hpp>
6 using namespace egHLT;
7 
9  const std::vector<std::pair<std::string,int> >& filters,
10  const trigger::TriggerEvent* trigEvt,
11  const std::string& hltTag,
12  const TrigCodes& trigCodes)
13 {
14  TrigCodes::TrigBitSet evtTrigs;
15  for(auto const & filter : filters){
16  size_t filterNrInEvt = trigEvt->filterIndex(edm::InputTag(filter.first,"",hltTag));
17  const TrigCodes::TrigBitSet filterCode = trigCodes.getCode(filter.first.c_str());
18  if(filterNrInEvt<trigEvt->sizeFilters()){ //filter found in event, however this only means that something passed the previous filter
19  const trigger::Keys& trigKeys = trigEvt->filterKeys(filterNrInEvt);
20  if(static_cast<int>(trigKeys.size())>=filter.second){
21  evtTrigs |=filterCode; //filter was passed
22  }
23  }//end check if filter is present
24  }//end loop over all filters
25 
26 
27  return evtTrigs;
28 
29 }
30 
31 
32 
33 
34 //this function runs over all parameter sets for every module that has ever run on an event in this job
35 //it looks for the specified filter module
36 //and returns the minimum number of objects required to pass the filter, -1 if its not found
37 //which is either the ncandcut or MinN parameter in the filter config
38 //assumption: nobody will ever change MinN or ncandcut without changing the filter name
39 //as this just picks the first module name and if 2 different versions of HLT were run with the filter having
40 //a different min obj required in the two versions, this may give the wrong answer
41 std::vector<int> trigTools::getMinNrObjsRequiredByFilter(const std::vector<std::string>& filterNames)
42 {
43  std::vector<int> retVal(filterNames.size(),-2);
44  const std::string mag0("@module_label");
45  const std::string mag1("ncandcut");
46  const std::string mag2("nZcandcut");
47  const std::string mag3("MinN");
48  const std::string mag4("minN");
49 
50  std::vector<std::string> filterEntryStrings;
51  filterEntryStrings.reserve(filterNames.size());
52  for (auto const & filterName : filterNames) {
53  const edm::Entry filterEntry(mag0,filterName,true);
54  filterEntryStrings.push_back(filterEntry.toString());
55  }
56 
57  //will return out of for loop once its found it to save time
58  const edm::pset::Registry* psetRegistry = edm::pset::Registry::instance();
59  if(psetRegistry==nullptr) { retVal=std::vector<int>(filterNames.size(),-1); return retVal;}
60  for(auto & psetIt : *psetRegistry){ //loop over every pset for every module ever run
61  const std::map<std::string,edm::Entry>& mapOfPara = psetIt.second.tbl(); //contains the parameter name and value for all the parameters of the pset
62  const auto itToModLabel = mapOfPara.find(mag0);
63  if(itToModLabel!=mapOfPara.end()){
64  std::string itString=itToModLabel->second.toString();
65 
66  for ( unsigned int i=0; i<filterNames.size(); i++) {
67  if ( retVal[i] == -1 ) continue; //already done
68 
69  if(itString==filterEntryStrings[i]){ //moduleName is the filter name, we have found filter, we will now return something
70  auto itToCandCut = mapOfPara.find(mag1);
71  if(itToCandCut!=mapOfPara.end() && itToCandCut->second.typeCode()=='I') retVal[i]=itToCandCut->second.getInt32();
72  else{ //checks if nZcandcut exists and is int32, if not return -1
73  itToCandCut = mapOfPara.find(mag2);
74  if(itToCandCut!=mapOfPara.end() && itToCandCut->second.typeCode()=='I') retVal[i]=itToCandCut->second.getInt32();
75  else{ //checks if MinN exists and is int32, if not return -1
76  itToCandCut = mapOfPara.find(mag3);
77  if(itToCandCut!=mapOfPara.end() && itToCandCut->second.typeCode()=='I') retVal[i]=itToCandCut->second.getInt32();
78  else{ //checks if minN exists and is int32, if not return -1
79  itToCandCut = mapOfPara.find(mag4);
80  if(itToCandCut!=mapOfPara.end() && itToCandCut->second.typeCode()=='I') retVal[i]= itToCandCut->second.getInt32();
81  else retVal[i]=-1;
82  }
83  }
84  }
85  }
86  }
87  }
88  }
89  for ( unsigned int i=0; i<filterNames.size(); i++)
90  if ( retVal[i]==-2 ) retVal[i]=-1;
91  return retVal;
92 }
93 
94 
95 
96 //this looks into the HLT config and fills a sorted vector with the last filter of all HLT triggers
97 //it assumes this filter is either the last (in the case of ES filters) or second to last in the sequence
98 /*void trigTools::getActiveFilters(const HLTConfigProvider& hltConfig,std::vector<std::string>& activeFilters)
99  {
100  activeFilters.clear();
101 
102  for(size_t pathNr=0;pathNr<hltConfig.size();pathNr++){
103  const std::string& pathName = hltConfig.triggerName(pathNr);
104  if(pathName.find("HLT_")==0){ //hlt path as they all start with HLT_XXXX
105 
106  std::string lastFilter;
107  const std::vector<std::string>& filters = hltConfig.moduleLabels(pathNr);
108  if(!filters.empty()){
109  if(filters.back()=="hltBoolEnd" && filters.size()>=2){
110  activeFilters.push_back(filters[filters.size()-2]); //2nd to last element is the last filter, useally the case as last is hltBool except for ES bits
111  }else activeFilters.push_back(filters.back());
112  //std::cout<<filters[filters.size()-2]<<std::endl;
113  }
114  }//end hlt path check
115  }//end path loop over
116 
117  std::sort(activeFilters.begin(),activeFilters.end());
118 
119  }*/
120 //----Morse--------------
121 //want to grab all modules with saveTags==true for e/g paths
122 //veto x-triggers, which will be handled by PAGs
123 //first step towards automation; for now it is just used to check against filtersToMon
124 //should have some overhead but they will be filtered out by filterInactiveTriggers anyway
125 void trigTools::getActiveFilters(const HLTConfigProvider& hltConfig,std::vector<std::string>& activeFilters,std::vector<std::string>& activeEleFilters,std::vector<std::string>& activeEle2LegFilters,std::vector<std::string>& activePhoFilters,std::vector<std::string>& activePho2LegFilters)
126 {
127 
128  activeFilters.clear();
129  activeEleFilters.clear();
130  activeEle2LegFilters.clear();
131  activePhoFilters.clear();
132  activePho2LegFilters.clear();
133 
134  for(size_t pathNr=0;pathNr<hltConfig.size();pathNr++){
135  const std::string& pathName = hltConfig.triggerName(pathNr);
136 
137  if(pathName.find("HLT_")==0){ //hlt path as they all start with HLT_XXXX
138  if((pathName.find("Photon")==4 || pathName.find("Ele")==4 || pathName.find("EG")!=pathName.npos
139  || pathName.find("PAPhoton")==4 || pathName.find("PAEle")==4 || pathName.find("PASinglePhoton")==4
140  || pathName.find("HIPhoton")==4 || pathName.find("HIEle")==4 || pathName.find("HISinglePhoton")==4
141  || pathName.find("Activity")==4 || pathName.find("Physics")==4 || pathName.find("DiSC") == 4)
142  && (pathName.find("Jet")==pathName.npos && pathName.find("Muon")==pathName.npos
143  && pathName.find("Tau")==pathName.npos && pathName.find("HT")==pathName.npos
144  && pathName.find("MR")==pathName.npos && pathName.find("LEITI")==pathName.npos
145  && pathName.find("Jpsi")==pathName.npos && pathName.find("Ups")==pathName.npos ) ){//veto x-triggers
146  //std::string lastFilter;
147  const std::vector<std::string>& filters = hltConfig.saveTagsModules(pathNr);
148 
149  //std::cout<<"Number of prescale sets: "<<hltConfig.prescaleSize()<<std::endl;
150  //std::cout<<std::endl<<"Path Name: "<<pathName<<" Prescale: "<<hltConfig.prescaleValue(1,pathName)<<std::endl;
151 
152  if(!filters.empty()){
153  //std::cout<<"Path Name: "<<pathName<<std::endl;
154  //if(filters.back()=="hltBoolEnd" && filters.size()>=2){
155  std::vector< int> minNRFFCache=getMinNrObjsRequiredByFilter(filters);
156 
157  for(size_t filter=0;filter<filters.size();filter++){
158  //std::cout << filters[filter] << std::endl;
159  if(filters[filter].find("Filter")!=filters[filter].npos){//keep only modules that contain the word "Filter"
160  //std::cout<<" Module Name: "<<filters[filter]<<" filter#: "<<int(filter)<<"/"<<filters.size()<<" ncandcut: "<<trigTools::getMinNrObjsRequiredByFilter(filters[filter])<<std::endl;
161  int minNRFF=minNRFFCache[filter];
162  int minNRFFP1=-99;
163  if ( filter<filters.size()-1) minNRFFP1=minNRFFCache[filter+1];
164  if(//keep only the last filter and the last one with ncandcut==1 (for di-object triggers)
165  ( minNRFF==1 && minNRFFP1==2)
166  || (minNRFF==1 && minNRFFP1==1 && filters[filter+1].find("Mass")!=filters[filter+1].npos)
167  || (minNRFF==1 && minNRFFP1==1 && filters[filter+1].find("FEM")!=filters[filter+1].npos)
168  || (minNRFF==1 && minNRFFP1==1 && filters[filter+1].find("PFMT")!=filters[filter+1].npos)
169  || filter==filters.size()-1 ){
170  activeFilters.push_back(filters[filter]); //saves all modules with saveTags=true
171 
172  //std::cout<<" Module Name: "<<filters[filter]<<" filter#: "<<int(filter)<<"/"<<filters.size()<<" ncandcut: "<<trigTools::getMinNrObjsRequiredByFilter(filters[filter])<<std::endl;
173  if(pathName.find("Photon")!=pathName.npos || pathName.find("Activity")!=pathName.npos || pathName.find("Physics")!=pathName.npos || pathName.find("DiSC") == 4){
174  activePhoFilters.push_back(filters[filter]);//saves all "Photon" paths into photon set
175  int posPho = pathName.find("Pho")+1;
176  if( pathName.find("Pho",posPho)!=pathName.npos || pathName.find("SC",posPho)!=pathName.npos) {
177  //This saves all "x_Photon_x_Photon_x" and "x_Photon_x_SC_x" path filters into 2leg photon set
178  activePho2LegFilters.push_back(filters[filter]);
179  //std::cout<<"Pho2LegPath: "<<pathName<<std::endl;
180  }
181  }
182  if(pathName.find("Ele")!=pathName.npos || pathName.find("Activity")!=pathName.npos || pathName.find("Physics")!=pathName.npos ){
183  activeEleFilters.push_back(filters[filter]);//saves all "Ele" paths into electron set
184  int posEle = pathName.find("Ele")+1;
185  if( pathName.find("Ele",posEle)!=pathName.npos || pathName.find("SC",posEle)!=pathName.npos ){
186  if(
187  ( minNRFF==1 && minNRFFP1==2)
188  || ( minNRFF==1 && minNRFFP1==1 && filters[filter+1].find("Mass")!=filters[filter+1].npos)
189  || ( minNRFF==1 && minNRFFP1==1 && filters[filter+1].find("SC")!=filters[filter+1].npos)
190  || ( minNRFF==1 && minNRFFP1==1 && filters[filter+1].find("FEM")!=filters[filter+1].npos)
191  ){
192  //This saves all "x_Ele_x_Ele_x" and "x_Ele_x_SC_x" path filters into 2leg electron set
193  activeEle2LegFilters.push_back(filters[filter]+"::"+filters[filter+1]);
194  //std::cout<<"Ele2LegPath: "<<pathName<<std::endl;
195  }
196  }
197  }
198  }
199  }
200  }
201  //std::cout<<filters[filters.size()-2]<<std::endl;
202  //}else activeFilters.push_back(filters.back());
203  }
204  }
205  }//end hlt path check
206  }//end path loop over
207  /*for(size_t i=0;i<activeEle2LegFilters.size();i++){
208  std::cout<<"Leg1: "<<activeEle2LegFilters[i].substr(0,activeEle2LegFilters[i].find("::"))<<std::endl;
209  std::cout<<"Leg2: "<<activeEle2LegFilters[i].substr(activeEle2LegFilters[i].find("::")+2)<<std::endl<<std::endl;
210  }*/
211  std::sort(activeFilters.begin(),activeFilters.end());
212  std::sort(activeEleFilters.begin(),activeEleFilters.end());
213  std::sort(activeEle2LegFilters.begin(),activeEle2LegFilters.end());
214  std::sort(activePhoFilters.begin(),activePhoFilters.end());
215 }
216 //----------------------------
217 
218 //this function will filter the inactive filternames
219 //it assumes the list of active filters is sorted
220 //at some point this will be replaced with one line of fancy stl code but I want it to work now :)
221 void trigTools::filterInactiveTriggers(std::vector<std::string>& namesToFilter,std::vector<std::string>& activeFilters)
222 {
223  //tempory vector to store the filtered results
224  std::vector<std::string> filteredNames;
225  /*
226  for(size_t inputFilterNr=0;inputFilterNr<namesToFilter.size();inputFilterNr++){
227  if(std::binary_search(activeFilters.begin(),activeFilters.end(),namesToFilter[inputFilterNr])){
228  filteredNames.push_back(namesToFilter[inputFilterNr]);
229  }//std::cout<<filteredNames[inputFilterNr]<<std::endl;
230  }
231  */
232  //namesToFilter.swap(activeFilters);
233  filteredNames = activeFilters;
234  namesToFilter.swap(filteredNames);
235 }
236 
237 //input filters have format filter1:filter2, this checks both filters are active, rejects ones where both are not active
238 void trigTools::filterInactiveTightLooseTriggers(std::vector<std::string>& namesToFilter,const std::vector<std::string>& activeFilters)
239 {
240  //tempory vector to store the filtered results
241  std::vector<std::string> filteredNames;
242 
243  for(auto & inputFilterNr : namesToFilter){
244  std::vector<std::string> names;
245  boost::split(names,inputFilterNr,boost::is_any_of(std::string(":")));
246  if(names.size()!=2) continue; //format incorrect, reject it
247  if(std::binary_search(activeFilters.begin(),activeFilters.end(),names[0]) &&
248  std::binary_search(activeFilters.begin(),activeFilters.end(),names[1])){ //both filters are valid
249  filteredNames.push_back(inputFilterNr);
250  }
251  }
252 
253  namesToFilter.swap(filteredNames);
254 }
255 
256 //a comparison functiod for std::pair<std::string,std::string>
257 //this probably (infact must) exist elsewhere
259 public:
260  bool operator()(const std::pair<std::string,std::string>&lhs,
261  const std::pair<std::string,std::string>& rhs)const{return keyLess(lhs.first,rhs.first);}
262  bool operator()(const std::pair<std::string,std::string>&lhs,
263  const std::pair<std::string,std::string>::first_type& rhs)const{return keyLess(lhs.first,rhs);}
264  bool operator()(const std::pair<std::string,std::string>::first_type &lhs,
265  const std::pair<std::string,std::string>& rhs)const{return keyLess(lhs,rhs.first);}
266 private:
267  bool keyLess(const std::pair<std::string,std::string>::first_type& k1,const std::pair<std::string,std::string>::first_type& k2)const{return k1<k2;}
268 };
269 
270 void trigTools::translateFiltersToPathNames(const HLTConfigProvider& hltConfig,const std::vector<std::string>& filters,std::vector<std::string>& paths)
271 {
272 
273  paths.clear();
274  std::vector<std::pair<std::string,std::string> > filtersAndPaths;
275 
276  for(size_t pathNr=0;pathNr<hltConfig.size();pathNr++){
277  const std::string& pathName = hltConfig.triggerName(pathNr);
278  if(pathName.find("HLT_")==0){ //hlt path as they all start with HLT_XXXX
279 
280  std::string lastFilter;
281  const std::vector<std::string>& pathFilters = hltConfig.moduleLabels(pathNr);
282  if(!pathFilters.empty()){
283  if(pathFilters.back()=="hltBoolEnd" && pathFilters.size()>=2){
284  //2nd to last element is the last filter, useally the case as last is hltBool except for ES bits
285  filtersAndPaths.push_back(std::make_pair(pathFilters[pathFilters.size()-2],pathName));
286  }else filtersAndPaths.push_back(std::make_pair(pathFilters.back(),pathName));
287  }
288  }//end hlt path check
289  }//end path loop over
290 
291  std::sort(filtersAndPaths.begin(),filtersAndPaths.end(),StringPairCompare());
292 
293  for(auto const & filter : filters){
294  typedef std::vector<std::pair<std::string,std::string> >::const_iterator VecIt;
295  std::pair<VecIt,VecIt> searchResult = std::equal_range(filtersAndPaths.begin(),filtersAndPaths.end(),filter,StringPairCompare());
296  if(searchResult.first!=searchResult.second) paths.push_back(searchResult.first->second);
297  else paths.push_back(filter);//if cant find the path, just write the filter
298  //---Morse-----
299  //std::cout<<filtersAndPaths[filterNr].first<<" "<<filtersAndPaths[filterNr].second<<std::endl;
300  //-------------
301  }
302 
303 }
304 
306 {
307  const std::vector<std::string>& modules = hltConfig.moduleLabels(path);
308 
309  for(auto const & moduleName : modules){
310  if(moduleName.find("hltL1s")==0) return moduleName; //found l1 seed module
311  }
313  return dummy;
314 
315 }
316 
317 //hunts for first instance of pattern EtX where X = a number of any length and returns X
319 {
320  size_t etStrPos = trigName.find("Et");
321  while(etStrPos!=std::string::npos && trigName.find_first_of("1234567890",etStrPos)!=etStrPos+2){
322  etStrPos = trigName.find("Et",etStrPos+1);
323  }
324  if(etStrPos!=std::string::npos && trigName.find_first_of("1234567890",etStrPos)==etStrPos+2){
325  size_t endOfEtValStr = trigName.find_first_not_of("1234567890",etStrPos+2);
326 
327  std::istringstream etValStr(trigName.substr(etStrPos+2,endOfEtValStr-etStrPos-2));
328  float etVal;
329  etValStr>> etVal;
330  return etVal;
331 
332  }
333  return 0;
334 
335 }
336 
337 //hunts for second instance of pattern X where X = a number of any length and returns X
338 //This has gotten ridiculously more complicated now that filters do not have the "Et" string in them
340 {//std::cout<<"What the heck is this trigName?:"<<trigName<<std::endl;
341  bool isEle=false,isPhoton=false,isEG=false,isEle2=false,isPhoton2=false,isEG2=false,isSC2=false;
342  size_t etStrPos = trigName.npos;
343  if( trigName.find("Ele")<trigName.find("Photon") && trigName.find("Ele")<trigName.find("EG") ){
344  etStrPos=trigName.find("Ele");isEle=true; }
345  else if( trigName.find("EG")<trigName.find("Photon") && trigName.find("EG")<trigName.find("Ele") ){
346  etStrPos=trigName.find("EG");isEG=true; }
347  else if( trigName.find("Photon")<trigName.find("Ele") && trigName.find("Photon")<trigName.find("EG") ){
348  etStrPos=trigName.find("Photon");isPhoton=true; }
349  //size_t etStrPos = trigName.find("Et");
350  //std::cout<<"Got Original Et spot; etStrPos="<<etStrPos<<std::endl;
351  /*while(etStrPos!=std::string::npos && trigName.find_first_of("1234567890",etStrPos)!=etStrPos+2){
352  etStrPos = trigName.find("Et",etStrPos+1);//std::cout<<"Got first Et spot; etStrPos="<<etStrPos<<std::endl;
353  }*/
354  if(etStrPos!=trigName.npos
355  && ( trigName.find("Ele",etStrPos+1)!=trigName.npos || trigName.find("EG",etStrPos+1)!=trigName.npos
356  || trigName.find("Photon",etStrPos+1)!=trigName.npos || trigName.find("SC",etStrPos+1)!=trigName.npos)){
357  if(trigName.find("Ele",etStrPos+1)<trigName.find("Photon",etStrPos+1) && trigName.find("Ele",etStrPos+1)<trigName.find("EG",etStrPos+1) && trigName.find("Ele",etStrPos+1)<trigName.find("SC",etStrPos+1) ){etStrPos=trigName.find("Ele",etStrPos+1);isEle2=true;}
358  else if(trigName.find("EG",etStrPos+1)<trigName.find("Photon",etStrPos+1) && trigName.find("EG",etStrPos+1)<trigName.find("Ele",etStrPos+1) && trigName.find("EG",etStrPos+1)<trigName.find("SC",etStrPos+1)){etStrPos=trigName.find("EG",etStrPos+1);isEG2=true;}
359  else if(trigName.find("Photon",etStrPos+1)<trigName.find("EG",etStrPos+1) && trigName.find("Photon",etStrPos+1)<trigName.find("Ele",etStrPos+1) && trigName.find("Photon",etStrPos+1)<trigName.find("SC",etStrPos+1)){etStrPos=trigName.find("Photon",etStrPos+1);isPhoton2=true;}
360  else if(trigName.find("SC",etStrPos+1)<trigName.find("EG",etStrPos+1) && trigName.find("SC",etStrPos+1)<trigName.find("Ele",etStrPos+1) && trigName.find("SC",etStrPos+1)<trigName.find("Photon",etStrPos+1)){etStrPos=trigName.find("Photon",etStrPos+1);isSC2=true;}
361  //std::cout<<"Got second Et spot; etStrPos="<<etStrPos<<std::endl;//}//get second instance. if it dne, keep first
362 
363  if(isEle2){
364  if(etStrPos!=trigName.npos && trigName.find_first_of("1234567890",etStrPos)==etStrPos+3){//std::cout<<"In if"<<std::endl;
365  size_t endOfEtValStr = trigName.find_first_not_of("1234567890",etStrPos+3);
366 
367  std::istringstream etValStr(trigName.substr(etStrPos+3,endOfEtValStr-etStrPos-3));
368  float etVal;
369  etValStr>> etVal;//std::cout<<"TrigName= "<<trigName<<" etVal= "<<etVal<<std::endl;
370  return etVal;
371  }
372  }
373  if(isEG2 || isSC2){
374  if(etStrPos!=trigName.npos && trigName.find_first_of("1234567890",etStrPos)==etStrPos+2){//std::cout<<"In if"<<std::endl;
375  size_t endOfEtValStr = trigName.find_first_not_of("1234567890",etStrPos+2);
376 
377  std::istringstream etValStr(trigName.substr(etStrPos+2,endOfEtValStr-etStrPos-2));
378  float etVal;
379  etValStr>> etVal;//std::cout<<"TrigName= "<<trigName<<" etVal= "<<etVal<<std::endl;
380  return etVal;
381  }
382  }
383 
384  if(isPhoton2){
385  if(etStrPos!=trigName.npos && trigName.find_first_of("1234567890",etStrPos)==etStrPos+6){//std::cout<<"In if"<<std::endl;
386  size_t endOfEtValStr = trigName.find_first_not_of("1234567890",etStrPos+6);
387 
388  std::istringstream etValStr(trigName.substr(etStrPos+6,endOfEtValStr-etStrPos-6));
389  float etVal;
390  etValStr>> etVal;//std::cout<<"TrigName= "<<trigName<<" etVal= "<<etVal<<std::endl;
391  return etVal;
392  }
393  }
394  }
395  else if(etStrPos!=trigName.npos){
396  if(isEle){
397  if(etStrPos!=trigName.npos && trigName.find_first_of("1234567890",etStrPos)==etStrPos+3){//std::cout<<"In if"<<std::endl;
398  size_t endOfEtValStr = trigName.find_first_not_of("1234567890",etStrPos+3);
399 
400  std::istringstream etValStr(trigName.substr(etStrPos+3,endOfEtValStr-etStrPos-3));
401  float etVal;
402  etValStr>> etVal;//std::cout<<"TrigName= "<<trigName<<" etVal= "<<etVal<<std::endl;
403  return etVal;
404  }
405  }
406  if(isEG){
407  if(etStrPos!=trigName.npos && trigName.find_first_of("1234567890",etStrPos)==etStrPos+2){//std::cout<<"In if"<<std::endl;
408  size_t endOfEtValStr = trigName.find_first_not_of("1234567890",etStrPos+2);
409 
410  std::istringstream etValStr(trigName.substr(etStrPos+2,endOfEtValStr-etStrPos-2));
411  float etVal;
412  etValStr>> etVal;//std::cout<<"TrigName= "<<trigName<<" etVal= "<<etVal<<std::endl;
413  return etVal;
414  }
415  }
416 
417  if(isPhoton){
418  if(etStrPos!=trigName.npos && trigName.find_first_of("1234567890",etStrPos)==etStrPos+6){//std::cout<<"In if"<<std::endl;
419  size_t endOfEtValStr = trigName.find_first_not_of("1234567890",etStrPos+6);
420 
421  std::istringstream etValStr(trigName.substr(etStrPos+6,endOfEtValStr-etStrPos-6));
422  float etVal;
423  etValStr>> etVal;//std::cout<<"TrigName= "<<trigName<<" etVal= "<<etVal<<std::endl;
424  return etVal;
425  }
426  }
427  }
428 
429  return 0;
430 
431 }
unsigned int size() const
number of trigger paths in trigger table
The single EDProduct to be saved for each event (AOD case)
Definition: TriggerEvent.h:25
const std::string & triggerName(unsigned int triggerIndex) const
static const HistoName names[]
TrigBitSet getCode(const char *descript) const
const Keys & filterKeys(trigger::size_type index) const
Definition: TriggerEvent.h:111
trigger::size_type filterIndex(const edm::InputTag &filterTag) const
find index of filter in data-member vector from filter tag
Definition: TriggerEvent.h:123
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:20
bool operator()(const std::pair< std::string, std::string >::first_type &lhs, const std::pair< std::string, std::string > &rhs) const
std::vector< TPRegexp > filters
Definition: eve_filter.cc:22
const std::vector< std::string > & saveTagsModules(unsigned int trigger) const
bool keyLess(const std::pair< std::string, std::string >::first_type &k1, const std::pair< std::string, std::string >::first_type &k2) const
std::string moduleName(Provenance const &provenance)
Definition: Provenance.cc:27
bool operator()(const std::pair< std::string, std::string > &lhs, const std::pair< std::string, std::string > &rhs) const
std::string getL1SeedFilterOfPath(const HLTConfigProvider &hltConfig, const std::string &path)
T mag2() const
The vector magnitude squared. Equivalent to vec.dot(vec)
std::vector< int > getMinNrObjsRequiredByFilter(const std::vector< std::string > &filterName)
float getEtThresFromName(const std::string &trigName)
TrigCodes::TrigBitSet getFiltersPassed(const std::vector< std::pair< std::string, int > > &filters, const trigger::TriggerEvent *trigEvt, const std::string &hltTag, const TrigCodes &trigCodes)
const std::vector< std::string > & moduleLabels(unsigned int trigger) const
label(s) of module(s) on a trigger path
void getActiveFilters(const HLTConfigProvider &hltConfig, std::vector< std::string > &activeFilters, std::vector< std::string > &activeEleFilters, std::vector< std::string > &activeEle2LegFilters, std::vector< std::string > &activePhoFilters, std::vector< std::string > &activePho2LegFilters)
std::vector< size_type > Keys
bool operator()(const std::pair< std::string, std::string > &lhs, const std::pair< std::string, std::string >::first_type &rhs) const
void filterInactiveTriggers(std::vector< std::string > &namesToFilter, std::vector< std::string > &activeFilters)
void filterInactiveTightLooseTriggers(std::vector< std::string > &namesToFilter, const std::vector< std::string > &activeFilters)
float getSecondEtThresFromName(const std::string &trigName)
std::string toString() const
Definition: Entry.cc:608
std::bitset< maxNrBits_ > TrigBitSet
double split
Definition: MVATrainer.cc:139
void translateFiltersToPathNames(const HLTConfigProvider &hltConfig, const std::vector< std::string > &filters, std::vector< std::string > &paths)
static Registry * instance()
Definition: Registry.cc:13