CMS 3D CMS Logo

/afs/cern.ch/work/a/aaltunda/public/www/CMSSW_6_2_5/src/DQMOffline/L1Trigger/src/L1TRate_Harvest.cc

Go to the documentation of this file.
00001 /*
00002  * \file L1TRate_Harvest.cc
00003  *
00004  * $Date: 2012/11/28 13:58:12 $
00005  * $Revision: 1.2 $
00006  * \author J. Pela, P. Musella
00007  *
00008  */
00009 
00010 // L1TMonitor includes
00011 #include "DQMOffline/L1Trigger/interface/L1TRate_Harvest.h"
00012 
00013 #include "DQMOffline/L1Trigger/interface/L1TMenuHelper.h"
00014 
00015 #include "DQMServices/Core/interface/DQMStore.h"
00016 
00017 #include "DataFormats/Scalers/interface/LumiScalers.h"
00018 #include "DataFormats/Scalers/interface/Level1TriggerRates.h"
00019 #include "DataFormats/Scalers/interface/Level1TriggerScalers.h"
00020 #include "DataFormats/L1GlobalTrigger/interface/L1GlobalTriggerReadoutRecord.h"
00021 #include "DataFormats/Common/interface/ConditionsInEdm.h" // Parameters associated to Run, LS and Event
00022 #include "DataFormats/Luminosity/interface/LumiDetails.h" // Luminosity Information
00023 #include "DataFormats/Luminosity/interface/LumiSummary.h" // Luminosity Information
00024 
00025 #include "CondFormats/L1TObjects/interface/L1GtTriggerMenu.h"
00026 #include "CondFormats/L1TObjects/interface/L1GtTriggerMenuFwd.h"
00027 #include "CondFormats/L1TObjects/interface/L1GtPrescaleFactors.h"
00028 #include "CondFormats/L1TObjects/interface/L1GtTriggerMask.h"            // L1Gt - Masks
00029 #include "CondFormats/DataRecord/interface/L1GtTriggerMaskAlgoTrigRcd.h" // L1Gt - Masks
00030 #include "CondFormats/DataRecord/interface/L1GtTriggerMenuRcd.h"
00031 #include "CondFormats/DataRecord/interface/L1GtPrescaleFactorsAlgoTrigRcd.h"
00032 
00033 #include "DataFormats/Histograms/interface/MEtoEDMFormat.h"
00034 
00035 #include "TList.h"
00036 
00037 using namespace edm;
00038 using namespace std;
00039 
00040 //_____________________________________________________________________
00041 L1TRate_Harvest::L1TRate_Harvest(const ParameterSet & ps){
00042 
00043   m_maxNbins   = 2500; // Maximum LS for each run (for binning purposes)
00044   m_parameters = ps;
00045 
00046   // Mapping parameter input variables
00047   m_scalersSource       = m_parameters.getParameter         <InputTag>("inputTagScalersResults");
00048   m_l1GtDataDaqInputTag = m_parameters.getParameter         <InputTag>("inputTagL1GtDataDaq");
00049   m_verbose             = m_parameters.getUntrackedParameter<bool>    ("verbose",false);
00050   m_refPrescaleSet      = m_parameters.getParameter         <int>     ("refPrescaleSet");  
00051   m_lsShiftGTRates      = m_parameters.getUntrackedParameter<int>     ("lsShiftGTRates",0);
00052   
00053   // Getting which categories to monitor
00054   ParameterSet Categories     = ps.getParameter<ParameterSet>("categories");  
00055   m_inputCategories["Mu"]     = Categories.getUntrackedParameter<bool>("Mu"); 
00056   m_inputCategories["EG"]     = Categories.getUntrackedParameter<bool>("EG"); 
00057   m_inputCategories["IsoEG"]  = Categories.getUntrackedParameter<bool>("IsoEG"); 
00058   m_inputCategories["Jet"]    = Categories.getUntrackedParameter<bool>("Jet"); 
00059   m_inputCategories["CenJet"] = Categories.getUntrackedParameter<bool>("CenJet"); 
00060   m_inputCategories["ForJet"] = Categories.getUntrackedParameter<bool>("ForJet"); 
00061   m_inputCategories["TauJet"] = Categories.getUntrackedParameter<bool>("TauJet"); 
00062   m_inputCategories["ETM"]    = Categories.getUntrackedParameter<bool>("ETM"); 
00063   m_inputCategories["ETT"]    = Categories.getUntrackedParameter<bool>("ETT"); 
00064   m_inputCategories["HTT"]    = Categories.getUntrackedParameter<bool>("HTT"); 
00065   m_inputCategories["HTM"]    = Categories.getUntrackedParameter<bool>("HTM"); 
00066 
00067   // Inicializing Variables
00068   dbe = NULL;
00069 
00070   if (ps.getUntrackedParameter < bool > ("dqmStore", false)) {
00071     dbe = Service < DQMStore > ().operator->();
00072     dbe->setVerbose(0);
00073   }
00074   
00075   // What to do if we want our output to be saved to a external file
00076   m_outputFile = ps.getUntrackedParameter < string > ("outputFile", "");
00077   
00078   if (m_outputFile.size() != 0) {
00079     cout << "L1T Monitoring histograms will be saved to " << m_outputFile.c_str() << endl;
00080   }
00081   
00082   bool disable = ps.getUntrackedParameter < bool > ("disableROOToutput", false);
00083   if (disable) {m_outputFile = "";}
00084   
00085   if (dbe != NULL) {dbe->setCurrentFolder("L1T/L1TRate_Harvest");}
00086   
00087 }
00088 
00089 //_____________________________________________________________________
00090 L1TRate_Harvest::~L1TRate_Harvest(){}
00091 
00092 //_____________________________________________________________________
00093 void L1TRate_Harvest::beginJob(void){
00094 
00095   if (m_verbose) {cout << "[L1TRate_Harvest:] Called beginJob." << endl;}
00096 
00097   // get hold of back-end interface
00098   DQMStore *dbe = 0;
00099   dbe = Service < DQMStore > ().operator->();
00100 
00101   if (dbe) {
00102     dbe->setCurrentFolder("L1T/L1TRate_Harvest");
00103     dbe->rmdir("L1T/L1TRate_Harvest");
00104   }
00105  
00106 }
00107 
00108 //_____________________________________________________________________
00109 void L1TRate_Harvest::endJob(void){
00110 
00111   if (m_verbose) {cout << "[L1TRate_Harvest:] Called endJob." << endl;}
00112 
00113   if (m_outputFile.size() != 0 && dbe)
00114     dbe->save(m_outputFile);
00115 
00116   return;
00117 
00118 }
00119 
00120 //_____________________________________________________________________
00121 // BeginRun: as input you get filtered events...
00122 //_____________________________________________________________________
00123 void L1TRate_Harvest::beginRun(const edm::Run& run, const edm::EventSetup& iSetup){
00124 
00125 //   if (m_verbose) {cout << "[L1TRate_Harvest:] Called beginRun." << endl;}
00126 
00127 //   ESHandle<L1GtTriggerMenu>     menuRcd;
00128 //   ESHandle<L1GtPrescaleFactors> l1GtPfAlgo;
00129 
00130 //   iSetup.get<L1GtTriggerMenuRcd>()            .get(menuRcd);
00131 //   iSetup.get<L1GtPrescaleFactorsAlgoTrigRcd>().get(l1GtPfAlgo);
00132 
00133 //   const L1GtTriggerMenu*     menu         = menuRcd   .product();
00134 //   const L1GtPrescaleFactors* m_l1GtPfAlgo = l1GtPfAlgo.product();
00135 
00136 //   // Initializing DQM Monitor Elements
00137 //   dbe->setCurrentFolder("L1T/L1TRate_Harvest");
00138 
00139 //   // Retriving the list of prescale sets
00140 //   m_listsPrescaleFactors = &(m_l1GtPfAlgo->gtPrescaleFactors());
00141  
00142 //   // Getting Lowest Prescale Single Object Triggers from the menu
00143 //   L1TMenuHelper myMenuHelper = L1TMenuHelper(iSetup);
00144 //   m_selectedTriggers = myMenuHelper.getLUSOTrigger(m_inputCategories,m_refPrescaleSet);
00145 
00146 //   //-> Getting template fits for the algLo cross sections
00147 //   int srcAlgoXSecFit = m_parameters.getParameter<int>("srcAlgoXSecFit");
00148 //   if     (srcAlgoXSecFit == 0){getXSexFitsOMDS  (m_parameters);}
00149 //   else if(srcAlgoXSecFit == 1){getXSexFitsPython(m_parameters);}
00150 
00151 //   for (CItAlgo algo = menu->gtAlgorithmMap().begin(); algo!=menu->gtAlgorithmMap().end(); ++algo){
00152 //     m_algoBit[(algo->second).algoAlias()] = (algo->second).algoBitNumber();    
00153 //   }
00154 
00155 // //   double minRate = m_parameters.getParameter<double>("minRate");
00156 // //   double maxRate = m_parameters.getParameter<double>("maxRate");
00157 
00158 //   // Initializing DQM Monitor Elements
00159 //   for(map<string,string>::const_iterator i=m_selectedTriggers.begin() ; i!=m_selectedTriggers.end() ; i++){
00160 
00161 //     TString tCategory     = (*i).first;
00162 //     TString tTrigger      = (*i).second;
00163 
00164 //     TString tErrorMessage = "";  
00165 //     TF1*    tTestFunction;
00166 
00167 //     if(tTrigger != "Undefined" && m_templateFunctions.find(tTrigger) != m_templateFunctions.end()){
00168 //       tTestFunction = m_templateFunctions[tTrigger];
00169 //     }
00170 //     else if(tTrigger == "Undefined"){
00171 //       TString tFunc = "-1";
00172 //       tTestFunction = new TF1("FitParametrization_"+tTrigger,tFunc,0,double(m_maxNbins)-0.5);
00173 //     }
00174 //     else if(m_templateFunctions.find(tTrigger) == m_templateFunctions.end()){
00175 //       TString tFunc = "-1";
00176 //       tTestFunction = new TF1("FitParametrization_"+tTrigger,tFunc,0,double(m_maxNbins)-0.5);
00177 //       tErrorMessage = " (Undefined Test Function)";
00178 //     }
00179 //     else{
00180 //       TString tFunc = "-1";
00181 //       tTestFunction = new TF1("FitParametrization_"+tTrigger,tFunc,0,double(m_maxNbins)-0.5);
00182 //     }
00183 
00184 //     if(tTrigger != "Undefined"){
00185 
00186 //     if(myMenuHelper.getPrescaleByAlias(tCategory,tTrigger) != 1){
00187 //       tErrorMessage += " WARNING: Default Prescale = ";
00188 //       tErrorMessage += myMenuHelper.getPrescaleByAlias(tCategory,tTrigger);
00189 //     }
00190 
00191 //     if     (tCategory == "Mu"    && myMenuHelper.getEtaRangeByAlias(tCategory,tTrigger) != 4294967295){ //hexadecimal of the whole range
00192 //         tErrorMessage += " WARNING: Eta Range = ";
00193 //         tErrorMessage += myMenuHelper.getEtaRangeByAlias(tCategory,tTrigger);
00194 //       }
00195 //       else if(tCategory == "EG"    && myMenuHelper.getEtaRangeByAlias(tCategory,tTrigger) != 32639){
00196 //         tErrorMessage += " WARNING: Eta Range = ";
00197 //         tErrorMessage += myMenuHelper.getEtaRangeByAlias(tCategory,tTrigger);
00198 //       }
00199 //       else if(tCategory == "IsoEG" && myMenuHelper.getEtaRangeByAlias(tCategory,tTrigger) != 32639){
00200 //         tErrorMessage += " WARNING: Eta Range = ";
00201 //         tErrorMessage += myMenuHelper.getEtaRangeByAlias(tCategory,tTrigger);
00202 //       }
00203 
00204 //       if(tCategory == "Mu" && myMenuHelper.getQualityAlias(tCategory,tTrigger) != 240){
00205 //         tErrorMessage += " WARNING: Quality = ";
00206 //         tErrorMessage += myMenuHelper.getQualityAlias(tCategory,tTrigger);      
00207 //       }
00208 
00209 //     }
00210 
00211 
00212 //     dbe->setCurrentFolder("L1T/L1TRate_Harvest/TriggerRates"); // rate of the trigger...
00213 //     m_xSecVsInstLumi[tTrigger] = dbe->book1D(tCategory,
00214 //                                           "Rate "+tTrigger+tErrorMessage,
00215 //                                           m_maxNbins,0.5,m_maxNbins+0.5); 
00216 //     m_xSecVsInstLumi[tTrigger] ->setAxisTitle("Luminosity Section" ,1);
00217 //     m_xSecVsInstLumi[tTrigger] ->setAxisTitle("Rate [Hz]" ,2);
00218 //     //    m_xSecVsInstLumi[tTrigger] ->getTProfile()->GetListOfFunctions()->Add(tTestFunction);
00219 //     m_xSecVsInstLumi[tTrigger] ->getTH1()->SetMarkerStyle(23);
00220 
00221 //   }  
00222 
00223 }
00224 
00225 //_____________________________________________________________________
00226 void L1TRate_Harvest::endRun(const edm::Run& run, const edm::EventSetup& iSetup){
00227 //    if (m_verbose) {cout << "[L1TRate_Harvest:] Called endRun." << endl;}
00228 }
00229 
00230 //_____________________________________________________________________
00231 void L1TRate_Harvest::beginLuminosityBlock(LuminosityBlock const& lumiBlock, EventSetup const& c) {
00232 
00233   //  if (m_verbose) {cout << "[L1TRate_Harvest:] Called beginLuminosityBlock at LS=" << lumiBlock.id().luminosityBlock() << endl;}
00234 
00235 }
00236 
00237 //_____________________________________________________________________
00238 void L1TRate_Harvest::endLuminosityBlock(LuminosityBlock const& lumiBlock, EventSetup const& c) {
00239 
00240 //   int eventLS = lumiBlock.id().luminosityBlock();  
00241 //   if (m_verbose) {cout << "[L1TRate_Harvest:] Called endLuminosityBlock at LS=" << eventLS << endl;}
00242 
00243 //   // We can certify LS -1 since we should have available:
00244 //   // gt rates: (current LS)-1
00245 //   // prescale: current LS
00246 //   // lumi    : current LS
00247 //   //eventLS--;
00248   
00249 //   // Checking if all necessary quantities are defined for our calculations
00250 //   bool isDefRate,isDefLumi,isDefPrescaleIndex;
00251 //   map<TString,double>* rates=0;
00252 //   double               lumi=0;
00253 //   int                  prescalesIndex=0;
00254 
00255 //   // Reseting MonitorElements so we can refill them
00256 //   for(map<string,string>::const_iterator i=m_selectedTriggers.begin() ; i!=m_selectedTriggers.end() ; i++){
00257 //     string tTrigger      = (*i).second;
00258 //     //    m_xSecObservedToExpected[tTrigger]->getTH1()->Reset("ICE");
00259 //     m_xSecVsInstLumi        [tTrigger]->getTH1()->Reset("ICE");
00260 //   }
00261     
00262 //   for(map<int,map<TString,double> >::iterator i=m_lsRates.begin() ; i!=m_lsRates.end() ; i++){
00263 
00264 //     unsigned int ls =  (*i).first;
00265 //     rates   = &(*i).second;
00266 //     isDefRate=true;
00267 
00268 //     if(m_lsLuminosity.find(ls)==m_lsLuminosity.end()){isDefLumi=false;}
00269 //     else{
00270 //       isDefLumi=true;
00271 //       lumi=m_lsLuminosity[ls];
00272 //     }
00273   
00274 //     if(m_lsPrescaleIndex.find(ls)==m_lsPrescaleIndex.end()){isDefPrescaleIndex=false;}
00275 //     else{
00276 //       isDefPrescaleIndex=true;
00277 //       prescalesIndex=m_lsPrescaleIndex[ls];
00278 //     }
00279     
00280 //     if(isDefRate && isDefLumi && isDefPrescaleIndex){
00281     
00282 //       const vector<int>& currentPrescaleFactors = (*m_listsPrescaleFactors).at(prescalesIndex);
00283      
00284 //       for(map<string,string>::const_iterator i=m_selectedTriggers.begin() ; i!=m_selectedTriggers.end() ; i++){
00285 
00286 //         string tTrigger      = (*i).second;
00287 //      //        TF1*   tTestFunction = (TF1*) m_xSecVsInstLumi[tTrigger]->getTProfile()->GetListOfFunctions()->First();
00288 
00289 //         // If trigger name is defined we get the rate fit parameters 
00290 //         if(tTrigger != "Undefined"){
00291 
00292 //           unsigned int   trigBit      = m_algoBit[tTrigger];
00293 //           double trigPrescale = currentPrescaleFactors[trigBit];
00294 //           double trigRate     = (*rates)[tTrigger];
00295 
00296 //           if(lumi!=0 && trigPrescale!=0 && trigRate!=0){
00297 
00298 //          //            double AlgoXSec              = (trigPrescale*trigRate)/lumi;
00299 //          //            double TemplateFunctionValue = tTestFunction->Eval(lumi);
00300 
00301 //             // Checking against Template function
00302 //             int ibin = m_xSecVsInstLumi[tTrigger]->getTH1()->FindBin(ls);
00303 //          //  m_xSecObservedToExpected[tTrigger]->setBinContent(ibin,AlgoXSec/TemplateFunctionValue);
00304 //             m_xSecVsInstLumi[tTrigger]->setBinContent(trigPrescale*trigRate,ibin);
00305   
00306 //          //            if(m_verbose){cout<<"[L1TRate_Harvest:] ls="<<ls<<" Algo="<<tTrigger<<" XSec="<<AlgoXSec<<" Test="<<AlgoXSec/TemplateFunctionValue<<endl;}
00307 
00308 //           }
00309 //        //          else{
00310 //        //             int ibin = m_xSecObservedToExpected[tTrigger]->getTH1()->FindBin(ls);
00311 //        //             m_xSecObservedToExpected[tTrigger]->setBinContent(ibin,0.000001);
00312 //        //             if(m_verbose){cout << "[L1TRate_Harvest:] Algo="<< tTrigger<< " XSec=Failed" << endl;}
00313 //        //}
00314 //         }
00315 //       }  
00316 //     }    
00317 //   }
00318 }
00319 
00320 //_____________________________________________________________________
00321 void L1TRate_Harvest::analyze(const Event & iEvent, const EventSetup & eventSetup){
00322 
00323 //   edm::Handle<L1GlobalTriggerReadoutRecord>   gtReadoutRecordData;
00324 //   edm::Handle<Level1TriggerScalersCollection> triggerScalers;
00325 //   edm::Handle<LumiScalersCollection>          colLScal;
00326  
00327 //   iEvent.getByLabel(m_l1GtDataDaqInputTag, gtReadoutRecordData);
00328 //   iEvent.getByLabel(m_scalersSource      , colLScal);
00329 //   iEvent.getByLabel(m_scalersSource      , triggerScalers);
00330 
00331 //   // Integers
00332 //   int  EventRun = iEvent.id().run();
00333 //   unsigned int eventLS  = iEvent.id().luminosityBlock();
00334 
00335 //   // Getting the trigger trigger rates from GT and buffering it
00336 //   if(triggerScalers.isValid()){
00337     
00338 //     Level1TriggerScalersCollection::const_iterator itL1TScalers = triggerScalers->begin();
00339 //     Level1TriggerRates trigRates(*itL1TScalers,EventRun);
00340     
00341 //     int gtLS = (*itL1TScalers).lumiSegmentNr()+m_lsShiftGTRates;
00342     
00343 //     // If we haven't got the data from this LS yet get it
00344 //     if(m_lsRates.find(gtLS)==m_lsRates.end()){
00345     
00346 //       if (m_verbose) {cout << "[L1TRate_Harvest:] Buffering GT Rates for LS=" << gtLS << endl;}
00347 //       map<TString,double> bufferRate;
00348       
00349 //       // Buffer the rate informations for all selected bits
00350 //       for(map<string,string>::const_iterator i=m_selectedTriggers.begin() ; i!=m_selectedTriggers.end() ; i++){
00351 
00352 //         string tTrigger = (*i).second;
00353 
00354 //         // If trigger name is defined we store the rate
00355 //         if(tTrigger != "Undefined"){
00356 
00357 //           unsigned int   trigBit  = m_algoBit[tTrigger];
00358 //           double trigRate = trigRates.gtAlgoCountsRate()[trigBit]; 
00359   
00360 //           bufferRate[tTrigger] = trigRate;
00361 //         }
00362 //       }
00363 //       m_lsRates[gtLS] = bufferRate;
00364 //     }
00365 //   }
00366   
00367 //   // Getting from the SCAL the luminosity information and buffering it
00368 //   if(colLScal.isValid() && colLScal->size()){
00369     
00370 //     LumiScalersCollection::const_iterator itLScal = colLScal->begin();
00371 //     unsigned int scalLS  = itLScal->sectionNumber();
00372     
00373 //     // If we haven't got the data from this SCAL LS yet get it
00374 //     if(m_lsLuminosity.find(scalLS)==m_lsLuminosity.end()){
00375     
00376 //       if (m_verbose) {cout << "[L1TRate_Harvest:] Buffering SCAL-HF Lumi for LS=" << scalLS << endl;}
00377 //       double instLumi       = itLScal->instantLumi();           // Getting Instant Lumi from HF (via SCAL)   
00378 //       double deadTimeNormHF = itLScal->deadTimeNormalization(); // Getting Dead Time Normalization from HF (via SCAL)
00379        
00380 //       // If HF Dead Time Corrections is requested we apply it
00381 //       // NOTE: By default this is assumed false since for now WbM fits do NOT assume this correction
00382 //       if(m_parameters.getUntrackedParameter<bool>("useHFDeadTimeNormalization",false)){
00383 
00384 //         // Protecting for deadtime = 0
00385 //         if(deadTimeNormHF==0){instLumi = 0;}
00386 //         else                 {instLumi = instLumi/deadTimeNormHF;}
00387 //       }
00388 //       // Buffering the luminosity information
00389 //       m_lsLuminosity[scalLS]=instLumi;
00390 //     }
00391 //   }
00392 
00393 //   // Getting the prescale index used when this event was triggered
00394 //   if(gtReadoutRecordData.isValid()){
00395     
00396 //     // If we haven't got the data from this LS yet get it
00397 //     if(m_lsPrescaleIndex.find(eventLS)==m_lsPrescaleIndex.end()){
00398       
00399 //       if (m_verbose) {cout << "[L1TRate_Harvest:] Buffering Prescale Index for LS=" << eventLS << endl;}
00400 
00401 //       // Getting Final Decision Logic (FDL) Data from GT
00402 //       const vector<L1GtFdlWord>& gtFdlVectorData = gtReadoutRecordData->gtFdlVector();
00403 
00404 //       // Getting the index for the fdl data for this event
00405 //       int indexFDL=0;
00406 //       for(unsigned int i=0; i<gtFdlVectorData.size(); i++){
00407 //         if(gtFdlVectorData[i].bxInEvent()==0){indexFDL=i; break;}
00408 //       }
00409       
00410 //       int CurrentPrescalesIndex  = gtFdlVectorData[indexFDL].gtPrescaleFactorIndexAlgo();
00411 //       m_lsPrescaleIndex[eventLS] = CurrentPrescalesIndex;   
00412 //     }    
00413 //   }
00414 }
00415     
00416 //_____________________________________________________________________
00417 // function: getXSexFitsPython
00418 // Imputs: 
00419 //   * const edm::ParameterSet& ps = ParameterSet contaning the fit
00420 //     functions and parameters for the selected triggers
00421 // Outputs:
00422 //   * int error = Number of algos where you did not find a 
00423 //     corresponding fit 
00424 //_____________________________________________________________________
00425 bool L1TRate_Harvest::getXSexFitsPython(const edm::ParameterSet& ps){
00426 
00427   // error meaning
00428   bool noError = true;
00429   cout<<"WP01"<<endl;
00430   // Getting fit parameters
00431   std::vector<edm::ParameterSet>  m_fitParameters = ps.getParameter< vector<ParameterSet> >("fitParameters");
00432   cout<<"WP02"<<endl;
00433   double minInstantLuminosity = m_parameters.getParameter<double>("minInstantLuminosity");
00434   double maxInstantLuminosity = m_parameters.getParameter<double>("maxInstantLuminosity");
00435   cout<<"WP03"<<endl;
00436   // Getting rate fit parameters for all input triggers
00437   for(map<string,string>::const_iterator a=m_selectedTriggers.begin() ; a!=m_selectedTriggers.end() ; a++){
00438   cout<<"WP04-1"<<endl;
00439     string tTrigger = (*a).second;
00440 
00441     // If trigger name is defined we get the rate fit parameters 
00442     if(tTrigger != "Undefined"){
00443       cout<<"WP04-2"<<endl;
00444       bool foundFit = false;
00445 
00446       for(unsigned int b=0 ; b<m_fitParameters.size() ; b++){
00447         cout<<"WP05-1"<<endl;
00448         if(tTrigger == m_fitParameters[b].getParameter<string>("AlgoName")){
00449           cout<<"WP05-2"<<endl;
00450           TString        tAlgoName          = m_fitParameters[b].getParameter< string >        ("AlgoName");
00451           TString        tTemplateFunction  = m_fitParameters[b].getParameter< string >        ("TemplateFunction");
00452           vector<double> tParameters        = m_fitParameters[b].getParameter< vector<double> >("Parameters");
00453           
00454           // Retriving and populating the m_templateFunctions array
00455           m_templateFunctions[tTrigger] = new TF1("FitParametrization_"+tAlgoName,tTemplateFunction,
00456                                                   minInstantLuminosity,maxInstantLuminosity);
00457           m_templateFunctions[tTrigger] ->SetParameters(&tParameters[0]);
00458           m_templateFunctions[tTrigger] ->SetLineWidth(1);
00459           m_templateFunctions[tTrigger] ->SetLineColor(kRed);
00460 
00461           foundFit = true;
00462           break;
00463         }
00464 
00465         if(!foundFit){
00466           cout<<"WP05-3"<<endl;
00467           noError = false;
00468 
00469           int eCount = m_ErrorMonitor->getTH1()->GetBinContent(WARNING_PY_MISSING_FIT);
00470           eCount++;
00471           m_ErrorMonitor->getTH1()->SetBinContent(WARNING_PY_MISSING_FIT,eCount);
00472 
00473           cout<<"WP05-4"<<endl;
00474         }
00475       }
00476     }
00477   }
00478 
00479    return noError;
00480 
00481 }
00482 
00483 
00484 //define this as a plug-in
00485 DEFINE_FWK_MODULE(L1TRate_Harvest);