CMS 3D CMS Logo

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