CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Types | Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes
L1TRate_Harvest Class Reference

#include <L1TRate_Harvest.h>

Inheritance diagram for L1TRate_Harvest:
edm::EDAnalyzer edm::EDConsumerBase

Public Types

enum  Errors { UNKNOWN = 1, WARNING_PY_MISSING_FIT = 2 }
 
- Public Types inherited from edm::EDAnalyzer
typedef EDAnalyzer ModuleType
 
typedef WorkerT< EDAnalyzerWorkerType
 

Public Member Functions

 L1TRate_Harvest (const edm::ParameterSet &ps)
 
virtual ~L1TRate_Harvest ()
 
- Public Member Functions inherited from edm::EDAnalyzer
 EDAnalyzer ()
 
std::string workerType () const
 
virtual ~EDAnalyzer ()
 
- Public Member Functions inherited from edm::EDConsumerBase
 EDConsumerBase ()
 
ProductHolderIndex indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductHolderIndex > &) const
 
void itemsToGet (BranchType, std::vector< ProductHolderIndex > &) const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void updateLookup (BranchType iBranchType, ProductHolderIndexHelper const &)
 
virtual ~EDConsumerBase ()
 

Protected Member Functions

void analyze (const edm::Event &e, const edm::EventSetup &c)
 
void beginJob ()
 
virtual void beginLuminosityBlock (edm::LuminosityBlock const &lumiBlock, edm::EventSetup const &c)
 
void beginRun (const edm::Run &run, const edm::EventSetup &iSetup)
 
void endJob ()
 
virtual void endLuminosityBlock (edm::LuminosityBlock const &lumiBlock, edm::EventSetup const &c)
 
void endRun (const edm::Run &run, const edm::EventSetup &iSetup)
 
- Protected Member Functions inherited from edm::EDAnalyzer
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
CurrentProcessingContext const * currentContext () const
 
- Protected Member Functions inherited from edm::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken consumes (TypeToGet const &id, edm::InputTag const &tag)
 
ConsumesCollector consumesCollector ()
 Use a ConsumesCollector to gather consumes information from helper functions. More...
 
template<typename ProductType , BranchType B = InEvent>
void consumesMany ()
 
void consumesMany (const TypeToGet &id)
 
template<BranchType B>
void consumesMany (const TypeToGet &id)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 

Private Member Functions

bool getXSexFitsOMDS (const edm::ParameterSet &ps)
 
bool getXSexFitsPython (const edm::ParameterSet &ps)
 

Private Attributes

DQMStoredbe
 
std::map< TString, int > m_algoBit
 
MonitorElementm_ErrorMonitor
 
std::map< std::string, bool > m_inputCategories
 
edm::InputTag m_l1GtDataDaqInputTag
 
const std::vector< std::vector
< int > > * 
m_listsPrescaleFactors
 
std::map< int, double > m_lsLuminosity
 
std::map< int, int > m_lsPrescaleIndex
 
std::map< int, std::map
< TString, double > > 
m_lsRates
 
int m_lsShiftGTRates
 
int m_maxNbins
 
std::string m_outputFile
 
edm::ParameterSet m_parameters
 
int m_refPrescaleSet
 
edm::InputTag m_scalersSource
 
std::map< std::string,
std::string > 
m_selectedTriggers
 
std::map< TString, TF1 * > m_templateFunctions
 
bool m_verbose
 
std::map< TString,
MonitorElement * > 
m_xSecObservedToExpected
 
std::map< TString,
MonitorElement * > 
m_xSecVsInstLumi
 

Additional Inherited Members

- Static Public Member Functions inherited from edm::EDAnalyzer
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &)
 

Detailed Description

Definition at line 42 of file L1TRate_Harvest.h.

Member Enumeration Documentation

Enumerator
UNKNOWN 
WARNING_PY_MISSING_FIT 

Definition at line 46 of file L1TRate_Harvest.h.

Constructor & Destructor Documentation

L1TRate_Harvest::L1TRate_Harvest ( const edm::ParameterSet ps)

Definition at line 41 of file L1TRate_Harvest.cc.

References gather_cfg::cout, edm::ParameterSet::getParameter(), edm::ParameterSet::getUntrackedParameter(), NULL, and cppFunctionSkipper::operator.

41  {
42 
43  m_maxNbins = 2500; // Maximum LS for each run (for binning purposes)
44  m_parameters = ps;
45 
46  // Mapping parameter input variables
47  m_scalersSource = m_parameters.getParameter <InputTag>("inputTagScalersResults");
48  m_l1GtDataDaqInputTag = m_parameters.getParameter <InputTag>("inputTagL1GtDataDaq");
49  m_verbose = m_parameters.getUntrackedParameter<bool> ("verbose",false);
50  m_refPrescaleSet = m_parameters.getParameter <int> ("refPrescaleSet");
51  m_lsShiftGTRates = m_parameters.getUntrackedParameter<int> ("lsShiftGTRates",0);
52 
53  // Getting which categories to monitor
54  ParameterSet Categories = ps.getParameter<ParameterSet>("categories");
55  m_inputCategories["Mu"] = Categories.getUntrackedParameter<bool>("Mu");
56  m_inputCategories["EG"] = Categories.getUntrackedParameter<bool>("EG");
57  m_inputCategories["IsoEG"] = Categories.getUntrackedParameter<bool>("IsoEG");
58  m_inputCategories["Jet"] = Categories.getUntrackedParameter<bool>("Jet");
59  m_inputCategories["CenJet"] = Categories.getUntrackedParameter<bool>("CenJet");
60  m_inputCategories["ForJet"] = Categories.getUntrackedParameter<bool>("ForJet");
61  m_inputCategories["TauJet"] = Categories.getUntrackedParameter<bool>("TauJet");
62  m_inputCategories["ETM"] = Categories.getUntrackedParameter<bool>("ETM");
63  m_inputCategories["ETT"] = Categories.getUntrackedParameter<bool>("ETT");
64  m_inputCategories["HTT"] = Categories.getUntrackedParameter<bool>("HTT");
65  m_inputCategories["HTM"] = Categories.getUntrackedParameter<bool>("HTM");
66 
67  // Inicializing Variables
68  dbe = NULL;
69 
70  if (ps.getUntrackedParameter < bool > ("dqmStore", false)) {
71  dbe = Service < DQMStore > ().operator->();
72  dbe->setVerbose(0);
73  }
74 
75  // What to do if we want our output to be saved to a external file
76  m_outputFile = ps.getUntrackedParameter < string > ("outputFile", "");
77 
78  if (m_outputFile.size() != 0) {
79  cout << "L1T Monitoring histograms will be saved to " << m_outputFile.c_str() << endl;
80  }
81 
82  bool disable = ps.getUntrackedParameter < bool > ("disableROOToutput", false);
83  if (disable) {m_outputFile = "";}
84 
85  if (dbe != NULL) {dbe->setCurrentFolder("L1T/L1TRate_Harvest");}
86 
87 }
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
std::map< std::string, bool > m_inputCategories
edm::InputTag m_scalersSource
#define NULL
Definition: scimark2.h:8
std::string m_outputFile
edm::InputTag m_l1GtDataDaqInputTag
edm::ParameterSet m_parameters
tuple cout
Definition: gather_cfg.py:121
L1TRate_Harvest::~L1TRate_Harvest ( )
virtual

Definition at line 90 of file L1TRate_Harvest.cc.

90 {}

Member Function Documentation

void L1TRate_Harvest::analyze ( const edm::Event e,
const edm::EventSetup c 
)
protectedvirtual

Implements edm::EDAnalyzer.

Definition at line 321 of file L1TRate_Harvest.cc.

321  {
322 
323 // edm::Handle<L1GlobalTriggerReadoutRecord> gtReadoutRecordData;
324 // edm::Handle<Level1TriggerScalersCollection> triggerScalers;
325 // edm::Handle<LumiScalersCollection> colLScal;
326 
327 // iEvent.getByLabel(m_l1GtDataDaqInputTag, gtReadoutRecordData);
328 // iEvent.getByLabel(m_scalersSource , colLScal);
329 // iEvent.getByLabel(m_scalersSource , triggerScalers);
330 
331 // // Integers
332 // int EventRun = iEvent.id().run();
333 // unsigned int eventLS = iEvent.id().luminosityBlock();
334 
335 // // Getting the trigger trigger rates from GT and buffering it
336 // if(triggerScalers.isValid()){
337 
338 // Level1TriggerScalersCollection::const_iterator itL1TScalers = triggerScalers->begin();
339 // Level1TriggerRates trigRates(*itL1TScalers,EventRun);
340 
341 // int gtLS = (*itL1TScalers).lumiSegmentNr()+m_lsShiftGTRates;
342 
343 // // If we haven't got the data from this LS yet get it
344 // if(m_lsRates.find(gtLS)==m_lsRates.end()){
345 
346 // if (m_verbose) {cout << "[L1TRate_Harvest:] Buffering GT Rates for LS=" << gtLS << endl;}
347 // map<TString,double> bufferRate;
348 
349 // // Buffer the rate informations for all selected bits
350 // for(map<string,string>::const_iterator i=m_selectedTriggers.begin() ; i!=m_selectedTriggers.end() ; i++){
351 
352 // string tTrigger = (*i).second;
353 
354 // // If trigger name is defined we store the rate
355 // if(tTrigger != "Undefined"){
356 
357 // unsigned int trigBit = m_algoBit[tTrigger];
358 // double trigRate = trigRates.gtAlgoCountsRate()[trigBit];
359 
360 // bufferRate[tTrigger] = trigRate;
361 // }
362 // }
363 // m_lsRates[gtLS] = bufferRate;
364 // }
365 // }
366 
367 // // Getting from the SCAL the luminosity information and buffering it
368 // if(colLScal.isValid() && colLScal->size()){
369 
370 // LumiScalersCollection::const_iterator itLScal = colLScal->begin();
371 // unsigned int scalLS = itLScal->sectionNumber();
372 
373 // // If we haven't got the data from this SCAL LS yet get it
374 // if(m_lsLuminosity.find(scalLS)==m_lsLuminosity.end()){
375 
376 // if (m_verbose) {cout << "[L1TRate_Harvest:] Buffering SCAL-HF Lumi for LS=" << scalLS << endl;}
377 // double instLumi = itLScal->instantLumi(); // Getting Instant Lumi from HF (via SCAL)
378 // double deadTimeNormHF = itLScal->deadTimeNormalization(); // Getting Dead Time Normalization from HF (via SCAL)
379 
380 // // If HF Dead Time Corrections is requested we apply it
381 // // NOTE: By default this is assumed false since for now WbM fits do NOT assume this correction
382 // if(m_parameters.getUntrackedParameter<bool>("useHFDeadTimeNormalization",false)){
383 
384 // // Protecting for deadtime = 0
385 // if(deadTimeNormHF==0){instLumi = 0;}
386 // else {instLumi = instLumi/deadTimeNormHF;}
387 // }
388 // // Buffering the luminosity information
389 // m_lsLuminosity[scalLS]=instLumi;
390 // }
391 // }
392 
393 // // Getting the prescale index used when this event was triggered
394 // if(gtReadoutRecordData.isValid()){
395 
396 // // If we haven't got the data from this LS yet get it
397 // if(m_lsPrescaleIndex.find(eventLS)==m_lsPrescaleIndex.end()){
398 
399 // if (m_verbose) {cout << "[L1TRate_Harvest:] Buffering Prescale Index for LS=" << eventLS << endl;}
400 
401 // // Getting Final Decision Logic (FDL) Data from GT
402 // const vector<L1GtFdlWord>& gtFdlVectorData = gtReadoutRecordData->gtFdlVector();
403 
404 // // Getting the index for the fdl data for this event
405 // int indexFDL=0;
406 // for(unsigned int i=0; i<gtFdlVectorData.size(); i++){
407 // if(gtFdlVectorData[i].bxInEvent()==0){indexFDL=i; break;}
408 // }
409 
410 // int CurrentPrescalesIndex = gtFdlVectorData[indexFDL].gtPrescaleFactorIndexAlgo();
411 // m_lsPrescaleIndex[eventLS] = CurrentPrescalesIndex;
412 // }
413 // }
414 }
void L1TRate_Harvest::beginJob ( void  )
protectedvirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 93 of file L1TRate_Harvest.cc.

References gather_cfg::cout, cppFunctionSkipper::operator, DQMStore::rmdir(), and DQMStore::setCurrentFolder().

93  {
94 
95  if (m_verbose) {cout << "[L1TRate_Harvest:] Called beginJob." << endl;}
96 
97  // get hold of back-end interface
98  DQMStore *dbe = 0;
99  dbe = Service < DQMStore > ().operator->();
100 
101  if (dbe) {
102  dbe->setCurrentFolder("L1T/L1TRate_Harvest");
103  dbe->rmdir("L1T/L1TRate_Harvest");
104  }
105 
106 }
void rmdir(const std::string &fullpath)
Definition: DQMStore.cc:2535
tuple cout
Definition: gather_cfg.py:121
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:434
void L1TRate_Harvest::beginLuminosityBlock ( edm::LuminosityBlock const &  lumiBlock,
edm::EventSetup const &  c 
)
protectedvirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 231 of file L1TRate_Harvest.cc.

231  {
232 
233  // if (m_verbose) {cout << "[L1TRate_Harvest:] Called beginLuminosityBlock at LS=" << lumiBlock.id().luminosityBlock() << endl;}
234 
235 }
void L1TRate_Harvest::beginRun ( const edm::Run run,
const edm::EventSetup iSetup 
)
protectedvirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 123 of file L1TRate_Harvest.cc.

123  {
124 
125 // if (m_verbose) {cout << "[L1TRate_Harvest:] Called beginRun." << endl;}
126 
127 // ESHandle<L1GtTriggerMenu> menuRcd;
128 // ESHandle<L1GtPrescaleFactors> l1GtPfAlgo;
129 
130 // iSetup.get<L1GtTriggerMenuRcd>() .get(menuRcd);
131 // iSetup.get<L1GtPrescaleFactorsAlgoTrigRcd>().get(l1GtPfAlgo);
132 
133 // const L1GtTriggerMenu* menu = menuRcd .product();
134 // const L1GtPrescaleFactors* m_l1GtPfAlgo = l1GtPfAlgo.product();
135 
136 // // Initializing DQM Monitor Elements
137 // dbe->setCurrentFolder("L1T/L1TRate_Harvest");
138 
139 // // Retriving the list of prescale sets
140 // m_listsPrescaleFactors = &(m_l1GtPfAlgo->gtPrescaleFactors());
141 
142 // // Getting Lowest Prescale Single Object Triggers from the menu
143 // L1TMenuHelper myMenuHelper = L1TMenuHelper(iSetup);
144 // m_selectedTriggers = myMenuHelper.getLUSOTrigger(m_inputCategories,m_refPrescaleSet);
145 
146 // //-> Getting template fits for the algLo cross sections
147 // int srcAlgoXSecFit = m_parameters.getParameter<int>("srcAlgoXSecFit");
148 // if (srcAlgoXSecFit == 0){getXSexFitsOMDS (m_parameters);}
149 // else if(srcAlgoXSecFit == 1){getXSexFitsPython(m_parameters);}
150 
151 // for (CItAlgo algo = menu->gtAlgorithmMap().begin(); algo!=menu->gtAlgorithmMap().end(); ++algo){
152 // m_algoBit[(algo->second).algoAlias()] = (algo->second).algoBitNumber();
153 // }
154 
155 // // double minRate = m_parameters.getParameter<double>("minRate");
156 // // double maxRate = m_parameters.getParameter<double>("maxRate");
157 
158 // // Initializing DQM Monitor Elements
159 // for(map<string,string>::const_iterator i=m_selectedTriggers.begin() ; i!=m_selectedTriggers.end() ; i++){
160 
161 // TString tCategory = (*i).first;
162 // TString tTrigger = (*i).second;
163 
164 // TString tErrorMessage = "";
165 // TF1* tTestFunction;
166 
167 // if(tTrigger != "Undefined" && m_templateFunctions.find(tTrigger) != m_templateFunctions.end()){
168 // tTestFunction = m_templateFunctions[tTrigger];
169 // }
170 // else if(tTrigger == "Undefined"){
171 // TString tFunc = "-1";
172 // tTestFunction = new TF1("FitParametrization_"+tTrigger,tFunc,0,double(m_maxNbins)-0.5);
173 // }
174 // else if(m_templateFunctions.find(tTrigger) == m_templateFunctions.end()){
175 // TString tFunc = "-1";
176 // tTestFunction = new TF1("FitParametrization_"+tTrigger,tFunc,0,double(m_maxNbins)-0.5);
177 // tErrorMessage = " (Undefined Test Function)";
178 // }
179 // else{
180 // TString tFunc = "-1";
181 // tTestFunction = new TF1("FitParametrization_"+tTrigger,tFunc,0,double(m_maxNbins)-0.5);
182 // }
183 
184 // if(tTrigger != "Undefined"){
185 
186 // if(myMenuHelper.getPrescaleByAlias(tCategory,tTrigger) != 1){
187 // tErrorMessage += " WARNING: Default Prescale = ";
188 // tErrorMessage += myMenuHelper.getPrescaleByAlias(tCategory,tTrigger);
189 // }
190 
191 // if (tCategory == "Mu" && myMenuHelper.getEtaRangeByAlias(tCategory,tTrigger) != 4294967295){ //hexadecimal of the whole range
192 // tErrorMessage += " WARNING: Eta Range = ";
193 // tErrorMessage += myMenuHelper.getEtaRangeByAlias(tCategory,tTrigger);
194 // }
195 // else if(tCategory == "EG" && myMenuHelper.getEtaRangeByAlias(tCategory,tTrigger) != 32639){
196 // tErrorMessage += " WARNING: Eta Range = ";
197 // tErrorMessage += myMenuHelper.getEtaRangeByAlias(tCategory,tTrigger);
198 // }
199 // else if(tCategory == "IsoEG" && myMenuHelper.getEtaRangeByAlias(tCategory,tTrigger) != 32639){
200 // tErrorMessage += " WARNING: Eta Range = ";
201 // tErrorMessage += myMenuHelper.getEtaRangeByAlias(tCategory,tTrigger);
202 // }
203 
204 // if(tCategory == "Mu" && myMenuHelper.getQualityAlias(tCategory,tTrigger) != 240){
205 // tErrorMessage += " WARNING: Quality = ";
206 // tErrorMessage += myMenuHelper.getQualityAlias(tCategory,tTrigger);
207 // }
208 
209 // }
210 
211 
212 // dbe->setCurrentFolder("L1T/L1TRate_Harvest/TriggerRates"); // rate of the trigger...
213 // m_xSecVsInstLumi[tTrigger] = dbe->book1D(tCategory,
214 // "Rate "+tTrigger+tErrorMessage,
215 // m_maxNbins,0.5,m_maxNbins+0.5);
216 // m_xSecVsInstLumi[tTrigger] ->setAxisTitle("Luminosity Section" ,1);
217 // m_xSecVsInstLumi[tTrigger] ->setAxisTitle("Rate [Hz]" ,2);
218 // // m_xSecVsInstLumi[tTrigger] ->getTProfile()->GetListOfFunctions()->Add(tTestFunction);
219 // m_xSecVsInstLumi[tTrigger] ->getTH1()->SetMarkerStyle(23);
220 
221 // }
222 
223 }
void L1TRate_Harvest::endJob ( void  )
protectedvirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 109 of file L1TRate_Harvest.cc.

References gather_cfg::cout.

109  {
110 
111  if (m_verbose) {cout << "[L1TRate_Harvest:] Called endJob." << endl;}
112 
113  if (m_outputFile.size() != 0 && dbe)
115 
116  return;
117 
118 }
void save(const std::string &filename, const std::string &path="", const std::string &pattern="", const std::string &rewrite="", SaveReferenceTag ref=SaveWithReference, int minStatus=dqm::qstatus::STATUS_OK, const std::string &fileupdate="RECREATE")
Definition: DQMStore.cc:2118
std::string m_outputFile
tuple cout
Definition: gather_cfg.py:121
void L1TRate_Harvest::endLuminosityBlock ( edm::LuminosityBlock const &  lumiBlock,
edm::EventSetup const &  c 
)
protectedvirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 238 of file L1TRate_Harvest.cc.

238  {
239 
240 // int eventLS = lumiBlock.id().luminosityBlock();
241 // if (m_verbose) {cout << "[L1TRate_Harvest:] Called endLuminosityBlock at LS=" << eventLS << endl;}
242 
243 // // We can certify LS -1 since we should have available:
244 // // gt rates: (current LS)-1
245 // // prescale: current LS
246 // // lumi : current LS
247 // //eventLS--;
248 
249 // // Checking if all necessary quantities are defined for our calculations
250 // bool isDefRate,isDefLumi,isDefPrescaleIndex;
251 // map<TString,double>* rates=0;
252 // double lumi=0;
253 // int prescalesIndex=0;
254 
255 // // Reseting MonitorElements so we can refill them
256 // for(map<string,string>::const_iterator i=m_selectedTriggers.begin() ; i!=m_selectedTriggers.end() ; i++){
257 // string tTrigger = (*i).second;
258 // // m_xSecObservedToExpected[tTrigger]->getTH1()->Reset("ICE");
259 // m_xSecVsInstLumi [tTrigger]->getTH1()->Reset("ICE");
260 // }
261 
262 // for(map<int,map<TString,double> >::iterator i=m_lsRates.begin() ; i!=m_lsRates.end() ; i++){
263 
264 // unsigned int ls = (*i).first;
265 // rates = &(*i).second;
266 // isDefRate=true;
267 
268 // if(m_lsLuminosity.find(ls)==m_lsLuminosity.end()){isDefLumi=false;}
269 // else{
270 // isDefLumi=true;
271 // lumi=m_lsLuminosity[ls];
272 // }
273 
274 // if(m_lsPrescaleIndex.find(ls)==m_lsPrescaleIndex.end()){isDefPrescaleIndex=false;}
275 // else{
276 // isDefPrescaleIndex=true;
277 // prescalesIndex=m_lsPrescaleIndex[ls];
278 // }
279 
280 // if(isDefRate && isDefLumi && isDefPrescaleIndex){
281 
282 // const vector<int>& currentPrescaleFactors = (*m_listsPrescaleFactors).at(prescalesIndex);
283 
284 // for(map<string,string>::const_iterator i=m_selectedTriggers.begin() ; i!=m_selectedTriggers.end() ; i++){
285 
286 // string tTrigger = (*i).second;
287 // // TF1* tTestFunction = (TF1*) m_xSecVsInstLumi[tTrigger]->getTProfile()->GetListOfFunctions()->First();
288 
289 // // If trigger name is defined we get the rate fit parameters
290 // if(tTrigger != "Undefined"){
291 
292 // unsigned int trigBit = m_algoBit[tTrigger];
293 // double trigPrescale = currentPrescaleFactors[trigBit];
294 // double trigRate = (*rates)[tTrigger];
295 
296 // if(lumi!=0 && trigPrescale!=0 && trigRate!=0){
297 
298 // // double AlgoXSec = (trigPrescale*trigRate)/lumi;
299 // // double TemplateFunctionValue = tTestFunction->Eval(lumi);
300 
301 // // Checking against Template function
302 // int ibin = m_xSecVsInstLumi[tTrigger]->getTH1()->FindBin(ls);
303 // // m_xSecObservedToExpected[tTrigger]->setBinContent(ibin,AlgoXSec/TemplateFunctionValue);
304 // m_xSecVsInstLumi[tTrigger]->setBinContent(trigPrescale*trigRate,ibin);
305 
306 // // if(m_verbose){cout<<"[L1TRate_Harvest:] ls="<<ls<<" Algo="<<tTrigger<<" XSec="<<AlgoXSec<<" Test="<<AlgoXSec/TemplateFunctionValue<<endl;}
307 
308 // }
309 // // else{
310 // // int ibin = m_xSecObservedToExpected[tTrigger]->getTH1()->FindBin(ls);
311 // // m_xSecObservedToExpected[tTrigger]->setBinContent(ibin,0.000001);
312 // // if(m_verbose){cout << "[L1TRate_Harvest:] Algo="<< tTrigger<< " XSec=Failed" << endl;}
313 // //}
314 // }
315 // }
316 // }
317 // }
318 }
void L1TRate_Harvest::endRun ( const edm::Run run,
const edm::EventSetup iSetup 
)
protectedvirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 226 of file L1TRate_Harvest.cc.

226  {
227 // if (m_verbose) {cout << "[L1TRate_Harvest:] Called endRun." << endl;}
228 }
bool L1TRate_Harvest::getXSexFitsOMDS ( const edm::ParameterSet ps)
private
bool L1TRate_Harvest::getXSexFitsPython ( const edm::ParameterSet ps)
private

Definition at line 425 of file L1TRate_Harvest.cc.

References a, b, gather_cfg::cout, and edm::ParameterSet::getParameter().

425  {
426 
427  // error meaning
428  bool noError = true;
429  cout<<"WP01"<<endl;
430  // Getting fit parameters
431  std::vector<edm::ParameterSet> m_fitParameters = ps.getParameter< vector<ParameterSet> >("fitParameters");
432  cout<<"WP02"<<endl;
433  double minInstantLuminosity = m_parameters.getParameter<double>("minInstantLuminosity");
434  double maxInstantLuminosity = m_parameters.getParameter<double>("maxInstantLuminosity");
435  cout<<"WP03"<<endl;
436  // Getting rate fit parameters for all input triggers
437  for(map<string,string>::const_iterator a=m_selectedTriggers.begin() ; a!=m_selectedTriggers.end() ; a++){
438  cout<<"WP04-1"<<endl;
439  string tTrigger = (*a).second;
440 
441  // If trigger name is defined we get the rate fit parameters
442  if(tTrigger != "Undefined"){
443  cout<<"WP04-2"<<endl;
444  bool foundFit = false;
445 
446  for(unsigned int b=0 ; b<m_fitParameters.size() ; b++){
447  cout<<"WP05-1"<<endl;
448  if(tTrigger == m_fitParameters[b].getParameter<string>("AlgoName")){
449  cout<<"WP05-2"<<endl;
450  TString tAlgoName = m_fitParameters[b].getParameter< string > ("AlgoName");
451  TString tTemplateFunction = m_fitParameters[b].getParameter< string > ("TemplateFunction");
452  vector<double> tParameters = m_fitParameters[b].getParameter< vector<double> >("Parameters");
453 
454  // Retriving and populating the m_templateFunctions array
455  m_templateFunctions[tTrigger] = new TF1("FitParametrization_"+tAlgoName,tTemplateFunction,
456  minInstantLuminosity,maxInstantLuminosity);
457  m_templateFunctions[tTrigger] ->SetParameters(&tParameters[0]);
458  m_templateFunctions[tTrigger] ->SetLineWidth(1);
459  m_templateFunctions[tTrigger] ->SetLineColor(kRed);
460 
461  foundFit = true;
462  break;
463  }
464 
465  if(!foundFit){
466  cout<<"WP05-3"<<endl;
467  noError = false;
468 
469  int eCount = m_ErrorMonitor->getTH1()->GetBinContent(WARNING_PY_MISSING_FIT);
470  eCount++;
471  m_ErrorMonitor->getTH1()->SetBinContent(WARNING_PY_MISSING_FIT,eCount);
472 
473  cout<<"WP05-4"<<endl;
474  }
475  }
476  }
477  }
478 
479  return noError;
480 
481 }
T getParameter(std::string const &) const
MonitorElement * m_ErrorMonitor
TH1 * getTH1(void) const
std::map< TString, TF1 * > m_templateFunctions
double b
Definition: hdecay.h:120
edm::ParameterSet m_parameters
double a
Definition: hdecay.h:121
std::map< std::string, std::string > m_selectedTriggers
tuple cout
Definition: gather_cfg.py:121

Member Data Documentation

DQMStore* L1TRate_Harvest::dbe
private

Definition at line 112 of file L1TRate_Harvest.h.

std::map<TString,int> L1TRate_Harvest::m_algoBit
private

Definition at line 94 of file L1TRate_Harvest.h.

MonitorElement* L1TRate_Harvest::m_ErrorMonitor
private

Definition at line 109 of file L1TRate_Harvest.h.

std::map<std::string,bool> L1TRate_Harvest::m_inputCategories
private

Definition at line 95 of file L1TRate_Harvest.h.

edm::InputTag L1TRate_Harvest::m_l1GtDataDaqInputTag
private

Definition at line 103 of file L1TRate_Harvest.h.

const std::vector< std::vector<int> >* L1TRate_Harvest::m_listsPrescaleFactors
private

Definition at line 88 of file L1TRate_Harvest.h.

std::map<int,double> L1TRate_Harvest::m_lsLuminosity
private

Definition at line 92 of file L1TRate_Harvest.h.

std::map<int,int> L1TRate_Harvest::m_lsPrescaleIndex
private

Definition at line 91 of file L1TRate_Harvest.h.

std::map<int,std::map<TString,double> > L1TRate_Harvest::m_lsRates
private

Definition at line 93 of file L1TRate_Harvest.h.

int L1TRate_Harvest::m_lsShiftGTRates
private

Definition at line 82 of file L1TRate_Harvest.h.

int L1TRate_Harvest::m_maxNbins
private

Definition at line 81 of file L1TRate_Harvest.h.

std::string L1TRate_Harvest::m_outputFile
private

Definition at line 85 of file L1TRate_Harvest.h.

edm::ParameterSet L1TRate_Harvest::m_parameters
private

Definition at line 106 of file L1TRate_Harvest.h.

int L1TRate_Harvest::m_refPrescaleSet
private

Definition at line 80 of file L1TRate_Harvest.h.

edm::InputTag L1TRate_Harvest::m_scalersSource
private

Definition at line 102 of file L1TRate_Harvest.h.

std::map<std::string,std::string> L1TRate_Harvest::m_selectedTriggers
private

Definition at line 96 of file L1TRate_Harvest.h.

std::map<TString,TF1*> L1TRate_Harvest::m_templateFunctions
private

Definition at line 99 of file L1TRate_Harvest.h.

bool L1TRate_Harvest::m_verbose
private

Definition at line 77 of file L1TRate_Harvest.h.

std::map<TString,MonitorElement*> L1TRate_Harvest::m_xSecObservedToExpected
private

Definition at line 97 of file L1TRate_Harvest.h.

std::map<TString,MonitorElement*> L1TRate_Harvest::m_xSecVsInstLumi
private

Definition at line 98 of file L1TRate_Harvest.h.