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