CMS 3D CMS Logo

HLTTauDQMSource.cc

Go to the documentation of this file.
00001 #include "DQM/HLTEvF/interface/HLTTauDQMSource.h"
00002 
00003 
00004 using namespace std;
00005 using namespace edm;
00006 using namespace reco;
00007 using namespace l1extra;
00008 using namespace trigger;
00009 
00010 //
00011 // constructors and destructor
00012 //
00013 HLTTauDQMSource::HLTTauDQMSource( const edm::ParameterSet& ps ) :counterEvt_(0)
00014 {
00015 
00016   //Get General Monitoring Parameters
00017   ParameterSet mainParams = ps.getParameter<edm::ParameterSet>("MonitorSetup");
00018   outputFile_             = ps.getUntrackedParameter < std::string > ("outputFile", "");
00019   disable_                = ps.getUntrackedParameter < bool > ("disableROOToutput", false);
00020   prescaleEvt_            = ps.getUntrackedParameter<int>("prescaleEvt", -1);
00021   verbose_                = ps.getUntrackedParameter < bool > ("verbose", false);
00022   EtMin_                  = ps.getUntrackedParameter < double > ("HistEtMin", 0);
00023   EtMax_                  = ps.getUntrackedParameter < double > ("HistEtMax", 100);
00024   NEtBins_                = ps.getUntrackedParameter < int > ("HistNEtBins",20 );
00025   NEtaBins_               = ps.getUntrackedParameter < int > ("HistNEtaBins",20 );
00026   mainFolder_             = ps.getUntrackedParameter < std::string > ("DQMFolder","HLT/HLTMonTau" );
00027   triggerEvent_           = ps.getUntrackedParameter < edm::InputTag > ("TriggerEvent");
00028 
00029   //MONITOR SETUP
00030   monitorName_            = mainParams.getUntrackedParameter<string>("monitorName","DoubleTau");
00031   nTriggeredTaus_         = mainParams.getUntrackedParameter < unsigned > ("NTriggeredTaus", 2);
00032   doBackup_               = mainParams.getUntrackedParameter < bool > ("UseBackupTriggers", false);
00033   l1Filter_               = mainParams.getUntrackedParameter<InputTag>("L1Seed");
00034   l2Reco_                 = mainParams.getUntrackedParameter<InputTag>("L2Reco");
00035   l2Filter_               = mainParams.getUntrackedParameter<InputTag>("L2EcalIsolJets");
00036   l25Filter_              = mainParams.getUntrackedParameter<InputTag>("L25PixelIsolJets");
00037   l3Filter_               = mainParams.getUntrackedParameter<InputTag>("L3SiliconIsolJets");
00038 
00039   //Backup Path
00040   mainPath_               = mainParams.getUntrackedParameter<edm::InputTag>("MainFilter");
00041   l1BackupPath_           = mainParams.getUntrackedParameter<edm::InputTag>("L1BackupFilter");
00042   l2BackupPath_           = mainParams.getUntrackedParameter<edm::InputTag>("L2BackupFilter");
00043   l25BackupPath_          = mainParams.getUntrackedParameter<edm::InputTag>("L25BackupFilter");
00044   l3BackupPath_           = mainParams.getUntrackedParameter<edm::InputTag>("L3BackupFilter");
00045 
00046   refFilters_             = mainParams.getUntrackedParameter<std::vector<edm::InputTag> >("refFilters");
00047   refIDs_                 = mainParams.getUntrackedParameter<std::vector<int> >("refFilterIDs");
00048   refFilterDesc_          = mainParams.getUntrackedParameter<std::vector<string> >("refFilterDescriptions");
00049   PtCut_                  = mainParams.getUntrackedParameter<std::vector<double> >("refObjectPtCut"); 
00050   corrDeltaR_             = mainParams.getUntrackedParameter<double>("matchingDeltaR",0.5);
00051   METCut_                 = mainParams.getUntrackedParameter<std::vector<double> >("METCut"); 
00052   MET_                    = mainParams.getUntrackedParameter<edm::InputTag>("MET");
00053 
00054   //L2 DQM Setup
00055   ParameterSet l2Params  = ps.getParameter<edm::ParameterSet>("L2Monitoring");
00056   doL2Monitoring_        = l2Params.getUntrackedParameter < bool > ("doL2Monitoring", false);
00057   l2AssocMap_            = l2Params.getUntrackedParameter<InputTag>("L2AssociationMap");
00058 
00059   //L25 DQM Setup
00060   ParameterSet l25Params  = ps.getParameter<edm::ParameterSet>("L25Monitoring");
00061   doL25Monitoring_        = l25Params.getUntrackedParameter < bool > ("doL25Monitoring", false);
00062   l25IsolInfo_            = l25Params.getUntrackedParameter<InputTag>("L25IsolatedTauTagInfo");
00063 
00064   //L3 DQM Setup
00065   ParameterSet l3Params  = ps.getParameter<edm::ParameterSet>("L3Monitoring");
00066   doL3Monitoring_        = l3Params.getUntrackedParameter < bool > ("doL3Monitoring", false);
00067   l3IsolInfo_            = l3Params.getUntrackedParameter<InputTag>("L3IsolatedTauTagInfo");
00068 
00069   dbe_ = Service < DQMStore > ().operator->();
00070   dbe_->setVerbose(0);
00071  
00072    if (disable_) {
00073      outputFile_ = "";
00074    }
00075 
00076    if (dbe_) {
00077      dbe_->setCurrentFolder(mainFolder_+"/"+monitorName_);
00078 
00079    }
00080 
00081 
00082   
00083   
00084 
00085 
00086 }
00087 
00088 
00089 HLTTauDQMSource::~HLTTauDQMSource()
00090 {
00091    
00092   // do anything here that needs to be done at desctruction time
00093   // (e.g. close files, deallocate resources etc.)
00094   
00095 }
00096 
00097 
00098 //--------------------------------------------------------
00099 void 
00100 HLTTauDQMSource::beginJob(const EventSetup& context){
00101 
00102  
00103    if (dbe_) 
00104      {
00105      
00106 
00107        //Book Histograms
00108 
00109        dbe_->setCurrentFolder(mainFolder_);
00110        //Book Static Histos
00111        triggerBitInfo_ = dbe_->book1D((monitorName_+"_triggerBitInclusive").c_str(),(monitorName_+":Trigger Bits (#tau inclusive)").c_str(),10,0,10);
00112        triggerBitInfo_->setAxisTitle("#tau Trigger Paths");
00113        triggerBitInfo_->setBinLabel(1,"");
00114        triggerBitInfo_->setBinLabel(2,"L1Seed");
00115        triggerBitInfo_->setBinLabel(3,"");
00116        triggerBitInfo_->setBinLabel(4,"L2Reco");
00117        triggerBitInfo_->setBinLabel(5,"");
00118        triggerBitInfo_->setBinLabel(6,"L2");
00119        triggerBitInfo_->setBinLabel(7,"");
00120        triggerBitInfo_->setBinLabel(8,"L2.5");
00121        triggerBitInfo_->setBinLabel(9,"");
00122        triggerBitInfo_->setBinLabel(10,"L3");
00123 
00124        
00125 
00126        if(doBackup_)
00127          {
00128            dbe_->setCurrentFolder(mainFolder_);
00129            triggerEfficiencyBackup_ = dbe_->book1D((monitorName_+"_EffRefToBackup").c_str(),(monitorName_+":#tau Path Efficiency w/ ref to Backup").c_str(),8,0,8);
00130            triggerEfficiencyBackup_->setAxisTitle("#tau Trigger Paths");
00131            triggerEfficiencyBackup_->setBinLabel(1,"");
00132            triggerEfficiencyBackup_->setBinLabel(2,"L1");
00133            triggerEfficiencyBackup_->setBinLabel(3,"");
00134            triggerEfficiencyBackup_->setBinLabel(4,"L2");
00135            triggerEfficiencyBackup_->setBinLabel(5,"");
00136            triggerEfficiencyBackup_->setBinLabel(6,"L25");
00137            triggerEfficiencyBackup_->setBinLabel(7,"");
00138            triggerEfficiencyBackup_->setBinLabel(8,"L3");
00139            triggerEfficiencyBackup_->setAxisRange(0,1,2);
00140         
00141        
00142          }
00143        //Book Reference Histos
00144 
00145        for(size_t i=0;i<refFilters_.size();++i)
00146          {
00147            dbe_->setCurrentFolder(mainFolder_);
00148            triggerBitInfoRef_.push_back(dbe_->book1D((monitorName_+"_triggerBitInfo_"+refFilterDesc_[i]).c_str(),(monitorName_+":Trigger Bit (match to "+refFilterDesc_[i] + ") ").c_str(),10,0,10));
00149 
00150            triggerBitInfoRef_[i]->setAxisTitle("#tau Trigger Paths");
00151            triggerBitInfoRef_[i]->setBinLabel(1,"");
00152            triggerBitInfoRef_[i]->setBinLabel(2,"L1Seed");
00153            triggerBitInfoRef_[i]->setBinLabel(3,"");
00154            triggerBitInfoRef_[i]->setBinLabel(4,"L2Reco");
00155            triggerBitInfoRef_[i]->setBinLabel(5,"");
00156            triggerBitInfoRef_[i]->setBinLabel(6,"L2");
00157            triggerBitInfoRef_[i]->setBinLabel(7,"");
00158            triggerBitInfoRef_[i]->setBinLabel(8,"L25");
00159            triggerBitInfoRef_[i]->setBinLabel(9,"");
00160            triggerBitInfoRef_[i]->setBinLabel(10,"L3");
00161           
00162 
00163            dbe_->setCurrentFolder(mainFolder_);
00164            triggerEfficiencyRef_.push_back(dbe_->book1D((monitorName_+"_triggerEfficiencyRefTo_"+refFilterDesc_[i]).c_str(),("#tau Path Efficiency with ref to "+refFilterDesc_[i]).c_str() ,10,0,10));
00165            triggerEfficiencyRef_[i]->setAxisTitle("#tau Trigger Paths");
00166            triggerEfficiencyRef_[i]->setBinLabel(1,"");
00167            triggerEfficiencyRef_[i]->setBinLabel(2,"L1Seed");
00168            triggerEfficiencyRef_[i]->setBinLabel(3,"");
00169            triggerEfficiencyRef_[i]->setBinLabel(4,"L2Reco");
00170            triggerEfficiencyRef_[i]->setBinLabel(5,"");
00171            triggerEfficiencyRef_[i]->setBinLabel(6,"L2");
00172            triggerEfficiencyRef_[i]->setBinLabel(7,"");
00173            triggerEfficiencyRef_[i]->setBinLabel(8,"L25");
00174            triggerEfficiencyRef_[i]->setBinLabel(9,"");
00175            triggerEfficiencyRef_[i]->setBinLabel(10,"L3");
00176            triggerEfficiencyRef_[i]->setAxisRange(0,1,2);
00177          }
00178            
00179      }
00180 
00181      //Initialize Counters;
00182      NEventsPassedL1     =0;
00183      NEventsPassedL2Reco =0;
00184      NEventsPassedL2     =0;
00185      NEventsPassedL25    =0;
00186      NEventsPassedL3     =0;
00187 
00188 
00189      //Efficiency Counters
00190      L1EffNum=0;
00191      L1EffDenom=0;
00192      L2EffNum=0;
00193      L2EffDenom=0;
00194      L25EffNum=0;
00195      L25EffDenom=0;
00196      L3EffNum=0;
00197      L3EffDenom=0;
00198      
00199      for(size_t i=0;i<refFilters_.size();++i)
00200        {
00201          NEventsPassedRefL1.push_back(0);
00202          NEventsPassedRefL2.push_back(0);
00203          NEventsPassedRefL2Reco.push_back(0);
00204          NEventsPassedRefL25.push_back(0);
00205          NEventsPassedRefL3.push_back(0);
00206          
00207          L1EffNumRef.push_back(0);
00208          L2RecoEffNumRef.push_back(0);
00209          L2EffNumRef.push_back(0);
00210          L25EffNumRef.push_back(0);
00211          L3EffNumRef.push_back(0);
00212 
00213          DenomRef.push_back(0);
00214 
00215          //L2RecoEffDenomRef.push_back(0);
00216          //L2EffDenomRef.push_back(0);
00217          //L25EffDenomRef.push_back(0);
00218          //L3EffDenomRef.push_back(0);
00219 
00220          
00221 
00222        }
00223 
00224      if(doL2Monitoring_)
00225        {  
00226          dbe_->setCurrentFolder(mainFolder_+"/"+monitorName_+"/L2CutDistos/"+"TauInclusive");
00227          L2JetEt_             = dbe_->book1D("L2JetEt","L2 Jet E_{t}",NEtBins_,EtMin_,EtMax_);
00228          L2JetEt_->setAxisTitle("Jet Candidate E_{t} [GeV]");
00229          L2JetEta_            = dbe_->book1D("L2JetEta","L2 Jet #eta",NEtaBins_,-2.5,2.5);
00230          L2JetEta_->setAxisTitle("Jet Candidate #eta");
00231          L2EcalIsolEt_        = dbe_->book1D("L2EcalIsolEt","L2 ECAL Isol. E_{t}",20,0,20);
00232          L2EcalIsolEt_->setAxisTitle("ECAL Isolated E_{t} [GeV]");
00233          L2TowerIsolEt_       = dbe_->book1D("L2TowerIsolEt","L2 Tower Isol. E_{t}",20,0,20);
00234          L2TowerIsolEt_->setAxisTitle("Tower isolation E_{t} [GeV]");
00235          L2SeedTowerEt_       = dbe_->book1D("L2SeedTowerEt","L2 Seed Tower E_{t}",20,0,60);
00236          L2SeedTowerEt_->setAxisTitle("Seed Tower E_{t} [GeV]");
00237          L2NClusters_         = dbe_->book1D("L2NClusters","L2 Number of Clusters",20,0,20);
00238          L2NClusters_->setAxisTitle("Number of Clusters");
00239          L2ClusterEtaRMS_     = dbe_->book1D("L2ClusterEtaRMS","L2 Cluster #eta RMS",20,0,1);
00240          L2ClusterEtaRMS_->setAxisTitle("Cluster #eta RMS");
00241          L2ClusterPhiRMS_     = dbe_->book1D("L2ClusterPhiRMS","L2 Cluster #phi RMS",20,0,1);
00242          L2ClusterPhiRMS_->setAxisTitle("Cluster #phi RMS");
00243          L2ClusterDeltaRRMS_  = dbe_->book1D("L2ClusterDRRMS","L2 Cluster #Delta R RMS",20,0,1);
00244          L2ClusterDeltaRRMS_->setAxisTitle("Cluster #Delta R RMS");
00245 
00246          //Book L2 Reference Histos
00247          for(size_t i=0;i<refFilters_.size();++i)
00248            {
00249              dbe_->setCurrentFolder(mainFolder_+"/"+monitorName_+"/L2CutDistos/"+refFilterDesc_[i]);
00250              L2JetEtRef_.push_back(dbe_->book1D("L2JetEt","L2 Jet E_{t}",NEtBins_,EtMin_,EtMax_));
00251              L2JetEtaRef_.push_back(dbe_->book1D("L2JetEta","L2 Jet #eta",NEtaBins_,-2.5,2.5));
00252              L2EcalIsolEtRef_.push_back(dbe_->book1D("L2EcalIsolEt","L2 ECAL Isol. E_{t}",20,0,20));
00253              L2TowerIsolEtRef_.push_back(dbe_->book1D("L2TowerIsolEt","L2 Tower Isol. E_{t}",20,0,20));
00254              L2SeedTowerEtRef_.push_back(dbe_->book1D("L2SeedTowerEt","L2 Seed Tower E_{t}",20,0,60));
00255              L2NClustersRef_.push_back(dbe_->book1D("L2NClusters","L2 Number of Clusters",20,0,20));
00256              L2ClusterEtaRMSRef_.push_back(dbe_->book1D("L2ClusterEtaRMS","L2 Cluster #eta RMS",20,0,1));
00257              L2ClusterPhiRMSRef_.push_back(dbe_->book1D("L2ClusterPhiRMS","L2 Cluster #phi RMS",20,0,1));
00258              L2ClusterDeltaRRMSRef_.push_back(dbe_->book1D("L2ClusterDRRMS","L2 Cluster #Delta R RMS",20,0,1));
00259          
00260              //Make Them beautiful
00261 
00262              L2JetEtRef_[i]->setAxisTitle("Jet Candidate E_{t} [GeV]");
00263              L2JetEtaRef_[i]->setAxisTitle("Jet Candidate #eta");
00264              L2EcalIsolEtRef_[i]->setAxisTitle("ECAL Isolated E_{t} [GeV]");
00265              L2TowerIsolEtRef_[i]->setAxisTitle("Tower isolation E_{t} [GeV]");
00266              L2SeedTowerEtRef_[i]->setAxisTitle("Seed Tower E_{t} [GeV]");
00267              L2NClustersRef_[i]->setAxisTitle("Number of Clusters");
00268              L2ClusterEtaRMSRef_[i]->setAxisTitle("Cluster #eta RMS");
00269              L2ClusterPhiRMSRef_[i]->setAxisTitle("Cluster #phi RMS");
00270              L2ClusterDeltaRRMSRef_[i]->setAxisTitle("Cluster #Delta R RMS");
00271            }
00272        }
00273 
00274      //Book L25 histos
00275      if(doL25Monitoring_)
00276        {
00277          dbe_->setCurrentFolder(mainFolder_+"/"+monitorName_+"/L25CutDistos/"+"TauInclusive");
00278          //Book Inclusive
00279          L25JetEt_           = dbe_->book1D("L25JetEt","L25 Jet Candidate E_{t}",NEtBins_,EtMin_,EtMax_);
00280          L25JetEt_->setAxisTitle("L25 Jet Candidate E_{t}");
00281          L25JetEta_          = dbe_->book1D("L25JetEta","L25 Jet Candidate #eta",NEtaBins_,-2.5,2.5);
00282          L25JetEta_->setAxisTitle("L25 Jet Candidate #eta");
00283          L25NPixelTracks_    = dbe_->book1D("L25NPixelTracks","L25 Number of Pixel Tracks",20,0,20);
00284          L25NPixelTracks_->setAxisTitle("L25 # of Pixel Tracks");
00285          L25NQPixelTracks_   = dbe_->book1D("L25NQPixelTracks","L25 Number of Pixel Tracks(After Q test)",20,0,20);
00286          L25NQPixelTracks_->setAxisTitle("L25 # of Quality Pixel Tracks");
00287          L25HasLeadingTrack_ = dbe_->book1D("L25HasLeadTrack","Leading Track(?)",2,0,2);
00288          L25HasLeadingTrack_->setBinLabel(1,"YES");
00289          L25HasLeadingTrack_->setBinLabel(2,"NO");
00290          L25LeadTrackPt_     = dbe_->book1D("L25LeadTrackPt","L25 Leading Track P_{t}",60,0,60);
00291          L25LeadTrackPt_->setAxisTitle("L25 Leading Track P_{t}");
00292          L25SumTrackPt_     = dbe_->book1D("L25SumTrackPt","L25 #Sigma Track P_{t}",100,0,100);
00293          L25LeadTrackPt_->setAxisTitle("L25 #Sigma Track P_{t}");
00294 
00295          //Book reference Histos
00296          for(size_t i=0;i<refFilters_.size();++i)
00297            {
00298 
00299              dbe_->setCurrentFolder(mainFolder_+"/"+monitorName_+"/L25CutDistos/"+refFilterDesc_[i]);
00300 
00301              L25JetEtRef_.push_back(dbe_->book1D("L25JetEt","L25 Jet Candidate E_{t}",NEtBins_,EtMin_,EtMax_));
00302              L25JetEtRef_[i]->setAxisTitle("L25 Jet Candidate E_{t}");
00303              L25JetEtaRef_.push_back(dbe_->book1D("L25JetEta","L25 Jet Candidate #eta",NEtaBins_,-2.5,2.5));
00304              L25JetEtaRef_[i]->setAxisTitle("L25 Jet Candidate #eta");
00305              L25NPixelTracksRef_.push_back(dbe_->book1D("L25NPixelTracks","L25 Number of Pixel Tracks",20,0,20));
00306              L25NPixelTracksRef_[i]->setAxisTitle("L25 # of Pixel Tracks");
00307              L25NQPixelTracksRef_.push_back(dbe_->book1D("L25NQPixelTracks","L25 Number of Pixel Tracks(After Q test)",20,0,20));
00308              L25NQPixelTracksRef_[i]->setAxisTitle("L25 # of Quality Pixel Tracks");
00309              L25HasLeadingTrackRef_.push_back(dbe_->book1D("L25HasLeadTrack","Leading Track(?)",2,0,2));
00310              L25HasLeadingTrackRef_[i]->setBinLabel(1,"YES");
00311              L25HasLeadingTrackRef_[i]->setBinLabel(2,"NO");
00312              L25LeadTrackPtRef_.push_back(dbe_->book1D("L25LeadTrackPt","L25 Leading Track P_{t}",60,0,60));
00313              L25LeadTrackPtRef_[i]->setAxisTitle("L25 Leading Track P_{t}");
00314              L25SumTrackPtRef_.push_back(dbe_->book1D("L25SumTrackPt","L25 #SigmaTrack P_{t}",60,0,60));
00315              L25SumTrackPtRef_[i]->setAxisTitle("L25 #Sigma Track P_{t}");
00316            }
00317 
00318        }
00319 
00320      //Book L3 histos
00321      if(doL3Monitoring_)
00322        {
00323          dbe_->setCurrentFolder(mainFolder_+"/"+monitorName_+"/L3CutDistos/"+"TauInclusive");
00324          //Book Inclusive
00325          L3JetEt_           = dbe_->book1D("L3JetEt","L3 Jet Candidate E_{t}",NEtBins_,EtMin_,EtMax_);
00326          L3JetEt_->setAxisTitle("L3 Jet Candidate E_{t}");
00327          L3JetEta_          = dbe_->book1D("L3JetEta","L3 Jet Candidate #eta",NEtaBins_,-2.5,2.5);
00328          L3JetEta_->setAxisTitle("L3 Jet Candidate #eta");
00329          L3NPixelTracks_    = dbe_->book1D("L3NPixelTracks","L3 Number of Pixel Tracks",20,0,20);
00330          L3NPixelTracks_->setAxisTitle("L3 # of Pixel Tracks");
00331          L3NQPixelTracks_   = dbe_->book1D("L3NQPixelTracks","L3 Number of Pixel Tracks(After Q test)",20,0,20);
00332          L3NQPixelTracks_->setAxisTitle("L3 # of Quality Pixel Tracks");
00333          L3HasLeadingTrack_ = dbe_->book1D("L3HasLeadTrack","Leading Track(?)",2,0,2);
00334          L3HasLeadingTrack_->setBinLabel(1,"YES");
00335          L3HasLeadingTrack_->setBinLabel(2,"NO");
00336          L3LeadTrackPt_     = dbe_->book1D("L3LeadTrackPt","L3 Leading Track P_{t}",60,0,60);
00337          L3LeadTrackPt_->setAxisTitle("L3 Leading Track P_{t}");
00338          L3SumTrackPt_     = dbe_->book1D("L3SumTrackPt","L3 #Sigma Track P_{t}",100,0,100);
00339          L3LeadTrackPt_->setAxisTitle("L3 #Sigma Track P_{t}");
00340 
00341          //Book reference Histos
00342          for(size_t i=0;i<refFilters_.size();++i)
00343            {
00344 
00345              dbe_->setCurrentFolder(mainFolder_+"/"+monitorName_+"/L3CutDistos/"+refFilterDesc_[i]);
00346 
00347              L3JetEtRef_.push_back(dbe_->book1D("L3JetEt","L3 Jet Candidate E_{t}",NEtBins_,EtMin_,EtMax_));
00348              L3JetEtRef_[i]->setAxisTitle("L3 Jet Candidate E_{t}");
00349              L3JetEtaRef_.push_back(dbe_->book1D("L3JetEta","L3 Jet Candidate #eta",NEtaBins_,-2.5,2.5));
00350              L3JetEtaRef_[i]->setAxisTitle("L3 Jet Candidate #eta");
00351              L3NPixelTracksRef_.push_back(dbe_->book1D("L3NPixelTracks","L3 Number of Pixel Tracks",20,0,20));
00352              L3NPixelTracksRef_[i]->setAxisTitle("L3 # of Pixel Tracks");
00353              L3NQPixelTracksRef_.push_back(dbe_->book1D("L3NQPixelTracks","L3 Number of Pixel Tracks(After Q test)",20,0,20));
00354              L3NQPixelTracksRef_[i]->setAxisTitle("L3 # of Quality Pixel Tracks");
00355              L3HasLeadingTrackRef_.push_back(dbe_->book1D("L3HasLeadTrack","Leading Track(?)",2,0,2));
00356              L3HasLeadingTrackRef_[i]->setBinLabel(1,"YES");
00357              L3HasLeadingTrackRef_[i]->setBinLabel(2,"NO");
00358              L3LeadTrackPtRef_.push_back(dbe_->book1D("L3LeadTrackPt","L3 Leading Track P_{t}",60,0,60));
00359              L3LeadTrackPtRef_[i]->setAxisTitle("L3 Leading Track P_{t}");
00360              L3SumTrackPtRef_.push_back(dbe_->book1D("L3SumTrackPt","L3 #SigmaTrack P_{t}",60,0,60));
00361              L3SumTrackPtRef_[i]->setAxisTitle("L3 #Sigma Track P_{t}");
00362            }
00363        }
00364 
00365 }
00366 
00367 //--------------------------------------------------------
00368 void HLTTauDQMSource::beginRun(const edm::Run& r, const EventSetup& context) {
00369 
00370 }
00371 
00372 //--------------------------------------------------------
00373 void HLTTauDQMSource::beginLuminosityBlock(const LuminosityBlock& lumiSeg, 
00374                                       const EventSetup& context) {
00375   
00376 }
00377 
00378 // ----------------------------------------------------------
00379 void 
00380 HLTTauDQMSource::analyze(const Event& iEvent, const EventSetup& iSetup )
00381 {  
00382   //Apply the prescaler
00383   if(counterEvt_ > prescaleEvt_)
00384     {
00385 
00386       //Do Summary Analysis
00387       doSummary(iEvent,iSetup);
00388 
00389       //Do L2 Analysis
00390       if(doL2Monitoring_)
00391         doL2(iEvent,iSetup);
00392 
00393       //Do L25 Analysis
00394       if(doL25Monitoring_)
00395         doL25(iEvent,iSetup);
00396     
00397       //Do L3 Analysis
00398       if(doL3Monitoring_)
00399         doL3(iEvent,iSetup);
00400   
00401       counterEvt_ = 0;
00402     }
00403   else
00404       counterEvt_++;
00405 
00406 }
00407 
00408 
00409 
00410 
00411 //--------------------------------------------------------
00412 void HLTTauDQMSource::endLuminosityBlock(const LuminosityBlock& lumiSeg, 
00413                                     const EventSetup& context) {
00414 }
00415 //--------------------------------------------------------
00416 void HLTTauDQMSource::endRun(const Run& r, const EventSetup& context){
00417 }
00418 //--------------------------------------------------------
00419 void HLTTauDQMSource::endJob(){
00420 
00421 
00422  
00423    if (outputFile_.size() != 0 && dbe_)
00424    dbe_->save(outputFile_);
00425  
00426   return;
00427 
00428 
00429 }
00430 
00431 
00432 void 
00433 HLTTauDQMSource::doSummary(const Event& iEvent, const EventSetup& iSetup)
00434 {
00435 
00436 
00437        //Do Backup triggers
00438        if(doBackup_)
00439          {
00440            bool passedMain = false;
00441           
00442            edm::Handle<TriggerEvent> tev;
00443            if(iEvent.getByLabel(triggerEvent_,tev))
00444              if(tev.isValid())
00445              {
00446              if(tev->filterIndex(mainPath_)!=tev->sizeFilters())
00447                 {
00448                   passedMain = true;
00449 
00450 
00451                 }
00452              if(tev->filterIndex(l1BackupPath_)!=tev->sizeFilters())
00453                 {
00454 
00455                   
00456                   L1EffDenom++;
00457                   if(passedMain)
00458                     {
00459                       L1EffNum++;
00460                       }
00461                 }
00462              if(tev->filterIndex(l2BackupPath_)!=tev->sizeFilters())
00463                 {
00464                   L2EffDenom++;
00465 
00466 
00467                   if(passedMain)
00468                    {
00469                      L2EffNum++;
00470                    }
00471                 }
00472              if(tev->filterIndex(l25BackupPath_)!=tev->sizeFilters())
00473                 {
00474                   L25EffDenom++;
00475                   if(passedMain)
00476                     L25EffNum++;
00477 
00478                 }
00479              if(tev->filterIndex(l3BackupPath_)!=tev->sizeFilters())
00480                { 
00481                   L3EffDenom++;
00482                   if(passedMain)
00483                     L3EffNum++;
00484 
00485                }
00486              
00487              }
00488 
00489          }
00490 
00491 
00492 
00493        //Do reference Trigger Analysis
00494 
00495       LVColl refObjects;
00496       std::vector<bool> RefBits;
00497       
00498       for(size_t i=0;i<refFilters_.size();++i)
00499         {
00500           RefBits.push_back(false);
00501         }
00502 
00503       //Retrieve MET
00504       double met=-1.0;
00505       Handle<reco::CaloMETCollection> MET;
00506       if(iEvent.getByLabel(MET_,MET))
00507         {
00508           met = (*MET)[0].pt();
00509         }
00510       
00511       
00512       for(size_t i=0;i<refFilters_.size();++i)
00513         {
00514           refObjects.clear();
00515           refObjects = importFilterColl(refFilters_[i],refIDs_[i],iEvent);
00516           size_t object_counter = 0;
00517           for(size_t j = 0 ; j< refObjects.size();++j)
00518             {
00519               if(refObjects[j].Pt()>PtCut_[i])
00520                 {
00521                   object_counter++;
00522                  
00523                 }
00524             }
00525           if(object_counter>=nTriggeredTaus_)
00526             {
00527               //Apply MET CUTS to the event
00528 
00529               if(METCut_[i]<0.5)
00530                 {
00531                   RefBits[i] = true;
00532                   DenomRef[i]++;
00533                 }
00534               else if(met>METCut_[i])
00535                 {
00536                   RefBits[i] = true;
00537                   DenomRef[i]++;
00538                 }
00539         
00540             }
00541   
00542         }
00543       
00544 
00545       //Look at the L1Trigger
00546       LVColl L1Taus = importObjectColl(l1Filter_,trigger::TriggerL1TauJet,iEvent);
00547           if(L1Taus.size()>=nTriggeredTaus_)
00548             {
00549               NEventsPassedL1++;
00550             }
00551           //Match With REFERENCE OBjects
00552           for(size_t i = 0;i<refFilters_.size();++i)
00553             {
00554               refObjects.clear();
00555               refObjects = importFilterColl(refFilters_[i],refIDs_[i],iEvent);
00556 
00557               size_t match_counter = 0;
00558                for(size_t j = 0;j<L1Taus.size();++j)
00559                 {
00560                   if(match(L1Taus[j],refObjects,corrDeltaR_,PtCut_[i]))
00561                     {
00562                       match_counter++;
00563                     }
00564                 }
00565                
00566               if(match_counter>=nTriggeredTaus_)
00567                 {
00568                     NEventsPassedRefL1[i]++;
00569                 }
00570                 
00571               if(match_counter>=nTriggeredTaus_ && RefBits[i])
00572                 {
00573                   L1EffNumRef[i]++;
00574                   // L1EffDenomRef[i]++;
00575                 }
00576               // else if(match_counter<nTriggeredTaus_ && RefBits[i])
00577               //        {
00578               //          L1EffDenomRef[i]++;
00579         
00580               //                }
00581 
00582 
00583             }
00584 
00585           //Look at the L2 Reconstruction
00586           LVColl L2RTaus = importObjectColl(l2Reco_,trigger::TriggerTau,iEvent);
00587           if(L2RTaus.size()>=nTriggeredTaus_)
00588             {
00589               NEventsPassedL2Reco++;
00590             
00591             }
00592           //Match With REFERENCE OBjects
00593           for(size_t i = 0;i<refFilters_.size();++i)
00594             {
00595               refObjects.clear();
00596               refObjects = importFilterColl(refFilters_[i],refIDs_[i],iEvent);
00597 
00598               size_t match_counter = 0;
00599                for(size_t j = 0;j<L2RTaus.size();++j)
00600                 {
00601                   if(match(L2RTaus[j],refObjects,corrDeltaR_,PtCut_[i]))
00602                     {
00603                       match_counter++;
00604                  
00605 
00606                     }
00607                 }
00608               if(match_counter>=nTriggeredTaus_)
00609                 {
00610                   NEventsPassedRefL2Reco[i]++;
00611                   
00612 
00613                 }
00614               if(match_counter>=nTriggeredTaus_ && RefBits[i])
00615                 {
00616                   L2RecoEffNumRef[i]++;
00617                   //  L2RecoEffDenomRef[i]++;
00618                 }
00619               // else if(match_counter<nTriggeredTaus_ && RefBits[i])
00620               //        {
00621               //          L2RecoEffDenomRef[i]++;
00622         
00623               //                }
00624           
00625 
00626             }
00627 
00628 
00629 
00630 
00631           //Look at the L2Trigger
00632       
00633           LVColl L2Taus = importObjectColl(l2Filter_,trigger::TriggerTau,iEvent);
00634 
00635 
00636           if(L2Taus.size()>=nTriggeredTaus_)
00637             {
00638               NEventsPassedL2++;
00639             
00640             }
00641           //Match With REFERENCE OBjects
00642           for(size_t i = 0;i<refFilters_.size();++i)
00643             {
00644               refObjects.clear();
00645               refObjects = importFilterColl(refFilters_[i],refIDs_[i],iEvent);
00646 
00647               size_t match_counter = 0;
00648                for(size_t j = 0;j<L2Taus.size();++j)
00649                 {
00650                   if(match(L2Taus[j],refObjects,corrDeltaR_,PtCut_[i]))
00651                     {
00652                       match_counter++;
00653                  
00654 
00655                     }
00656                 }
00657               if(match_counter>=nTriggeredTaus_)
00658                 {
00659                   NEventsPassedRefL2[i]++;
00660                    
00661                 }
00662               if(match_counter>=nTriggeredTaus_ && RefBits[i])
00663                 {
00664                   L2EffNumRef[i]++;
00665                   //  L2EffDenomRef[i]++;
00666                 }
00667               //              else if(match_counter<nTriggeredTaus_ && RefBits[i])
00668               //        {
00669               //          L2EffDenomRef[i]++;
00670               //        
00671               //        }
00672           
00673 
00674 
00675           
00676 
00677             }
00678 
00679 
00680 
00681 
00682         
00683 
00684       //Look at the L25Trigger
00685       
00686           LVColl L25Taus = importObjectColl(l25Filter_,trigger::TriggerTau,iEvent);
00687 
00688           if(L25Taus.size()>=nTriggeredTaus_)
00689             {
00690               NEventsPassedL25++;
00691             
00692             }
00693           //Match With REFERENCE OBjects
00694           for(size_t i = 0;i<refFilters_.size();++i)
00695             {
00696               refObjects.clear();
00697               refObjects = importFilterColl(refFilters_[i],refIDs_[i],iEvent);
00698 
00699               size_t match_counter = 0;
00700                for(size_t j = 0;j<L25Taus.size();++j)
00701                 {
00702                   if(match(L25Taus[j],refObjects,corrDeltaR_,PtCut_[i]))
00703                     {
00704                       match_counter++;
00705                     }
00706                 }
00707               if(match_counter>=nTriggeredTaus_)
00708                 {
00709                   NEventsPassedRefL25[i]++;
00710                 
00711                 
00712                 }
00713               if(match_counter>=nTriggeredTaus_ && RefBits[i])
00714                 {
00715                   L25EffNumRef[i]++;
00717                 }
00718               //  else if(match_counter<nTriggeredTaus_ && RefBits[i])
00719               //        {
00720               //          L25EffDenomRef[i]++;
00721         
00722               //                }
00723           
00724           
00725 
00726             }
00727 
00728         
00729 
00730 
00731       //Look at the L3Trigger
00732           LVColl L3Taus = importObjectColl(l3Filter_,trigger::TriggerTau,iEvent);
00733 
00734           if(L3Taus.size()>=nTriggeredTaus_)
00735             {
00736               NEventsPassedL3++;
00737             
00738             }
00739 
00740           //Match With REFERENCE OBjects
00741           for(size_t i = 0;i<refFilters_.size();++i)
00742             {
00743               refObjects.clear();
00744               refObjects = importFilterColl(refFilters_[i],refIDs_[i],iEvent);
00745 
00746               size_t match_counter = 0;
00747                for(size_t j = 0;j<L3Taus.size();++j)
00748                 {
00749                   if(match(L3Taus[j],refObjects,corrDeltaR_,PtCut_[i]))
00750                     {
00751                       match_counter++;
00752                     }
00753                 }
00754               if(match_counter>=nTriggeredTaus_)
00755                 {
00756                   NEventsPassedRefL3[i]++;
00757                 
00758                 }
00759               if(match_counter>=nTriggeredTaus_ && RefBits[i])
00760                 {
00761                   L3EffNumRef[i]++;
00763                 }
00764               //  else if(match_counter<nTriggeredTaus_ && RefBits[i])
00765               //        {
00766               //          L3EffDenomRef[i]++;
00767               //        
00768               //        }
00769         
00770             }
00771 
00772 
00773       //Fill Histogram Information
00774 
00775       triggerBitInfo_->setBinContent(2,NEventsPassedL1);
00776       triggerBitInfo_->setBinContent(4,NEventsPassedL2Reco);
00777       triggerBitInfo_->setBinContent(6,NEventsPassedL2);
00778       triggerBitInfo_->setBinContent(8,NEventsPassedL25);
00779       triggerBitInfo_->setBinContent(10,NEventsPassedL3);
00780       
00781       //Efficiency with ref to Backup
00782       if(doBackup_)
00783         {
00784           triggerEfficiencyBackup_->setBinContent(2,calcEfficiency(L1EffNum,L1EffDenom)[0]);
00785           triggerEfficiencyBackup_->setBinError(2,calcEfficiency(L1EffNum,L1EffDenom)[1]);
00786           triggerEfficiencyBackup_->setBinContent(4,calcEfficiency(L2EffNum,L2EffDenom)[0]);
00787           triggerEfficiencyBackup_->setBinError(4,calcEfficiency(L2EffNum,L2EffDenom)[1]);
00788           triggerEfficiencyBackup_->setBinContent(6,calcEfficiency(L25EffNum,L25EffDenom)[0]);
00789           triggerEfficiencyBackup_->setBinError(6,calcEfficiency(L25EffNum,L25EffDenom)[1]);
00790           triggerEfficiencyBackup_->setBinContent(8,calcEfficiency(L3EffNum,L3EffDenom)[0]);
00791           triggerEfficiencyBackup_->setBinError(8,calcEfficiency(L3EffNum,L3EffDenom)[1]);
00792         }
00793 
00794       //REFERENCE TRIGGER STUFF
00795       for(size_t i=0;i<refFilters_.size();++i)
00796         {
00797           triggerBitInfoRef_[i]->setBinContent(2,NEventsPassedRefL1[i]);
00798           triggerBitInfoRef_[i]->setBinContent(4,NEventsPassedRefL2Reco[i]);
00799           triggerBitInfoRef_[i]->setBinContent(6,NEventsPassedRefL2[i]);
00800           triggerBitInfoRef_[i]->setBinContent(8,NEventsPassedRefL25[i]);
00801           triggerBitInfoRef_[i]->setBinContent(10,NEventsPassedRefL3[i]);
00802 
00803           //Efficiency With Ref to Reference trigger
00804           triggerEfficiencyRef_[i]->setBinContent(2,calcEfficiency(L1EffNumRef[i],DenomRef[i])[0]);
00805           triggerEfficiencyRef_[i]->setBinError(2,calcEfficiency(L1EffNumRef[i],DenomRef[i])[1]);
00806           triggerEfficiencyRef_[i]->setBinContent(4,calcEfficiency(L2RecoEffNumRef[i],DenomRef[i])[0]);
00807           triggerEfficiencyRef_[i]->setBinError(4,calcEfficiency(L2RecoEffNumRef[i],DenomRef[i])[1]);
00808           triggerEfficiencyRef_[i]->setBinContent(6,calcEfficiency(L2EffNumRef[i],DenomRef[i])[0]);
00809           triggerEfficiencyRef_[i]->setBinError(6,calcEfficiency(L2EffNumRef[i],DenomRef[i])[1]);
00810           triggerEfficiencyRef_[i]->setBinContent(8,calcEfficiency(L25EffNumRef[i],DenomRef[i])[0]);
00811           triggerEfficiencyRef_[i]->setBinError(8,calcEfficiency(L25EffNumRef[i],DenomRef[i])[1]);
00812           triggerEfficiencyRef_[i]->setBinContent(10,calcEfficiency(L3EffNumRef[i],DenomRef[i])[0]);
00813           triggerEfficiencyRef_[i]->setBinError(10,calcEfficiency(L3EffNumRef[i],DenomRef[i])[1]);
00814 
00815         }
00816 
00817 
00818     
00819 }
00820 
00821 void 
00822 HLTTauDQMSource::doL2(const Event& iEvent, const EventSetup& iSetup)
00823 {
00824 
00825        Handle<L2TauInfoAssociation> l2TauInfoAssoc; //Handle to the input (L2 Tau Info Association)
00826 
00827 
00828        if(iEvent.getByLabel(l2AssocMap_,l2TauInfoAssoc))
00829          {
00830 
00831                 //If the Collection exists do work
00832                 if(l2TauInfoAssoc->size()>0)
00833                   for(L2TauInfoAssociation::const_iterator p = l2TauInfoAssoc->begin();p!=l2TauInfoAssoc->end();++p)
00834                     {
00835                       //Retrieve The L2TauIsolationInfo Class from the AssociationMap
00836                       const L2TauIsolationInfo l2info = p->val;
00837                       //Retrieve the Jet From the AssociationMap
00838                       const Jet& jet =*(p->key);
00839                       
00840                       //Fill Inclusive Histos
00841                       L2JetEt_->Fill(jet.et());
00842                       L2JetEta_->Fill(jet.eta());
00843                       L2EcalIsolEt_->Fill(l2info.ECALIsolConeCut);
00844                       L2TowerIsolEt_->Fill(l2info.TowerIsolConeCut);
00845                       L2SeedTowerEt_->Fill(l2info.SeedTowerEt);
00846                       L2NClusters_->Fill(l2info.ECALClusterNClusters);
00847                       L2ClusterEtaRMS_->Fill(l2info.ECALClusterEtaRMS);
00848                       L2ClusterPhiRMS_->Fill(l2info.ECALClusterPhiRMS);
00849                       L2ClusterDeltaRRMS_->Fill(l2info.ECALClusterDRRMS);
00850 
00851                       //Fill Reference Histos
00852                     for(size_t i=0;i<refFilters_.size();++i)
00853                       {
00854                         //Get reference Objects
00855                         LVColl refObjects = importFilterColl(refFilters_[i],refIDs_[i],iEvent);
00856                         //Match Jet
00857                         if(match(jet.p4(),refObjects,corrDeltaR_,PtCut_[i]))
00858                           {
00859                             //Fill the other histos!!
00860                             L2JetEtRef_[i]->Fill(jet.et());
00861                             L2JetEtaRef_[i]->Fill(jet.eta());
00862                             L2EcalIsolEtRef_[i]->Fill(l2info.ECALIsolConeCut);
00863                             L2TowerIsolEtRef_[i]->Fill(l2info.TowerIsolConeCut);
00864                             L2SeedTowerEtRef_[i]->Fill(l2info.SeedTowerEt);
00865                             L2NClustersRef_[i]->Fill(l2info.ECALClusterNClusters);
00866                             L2ClusterEtaRMSRef_[i]->Fill(l2info.ECALClusterEtaRMS);
00867                             L2ClusterPhiRMSRef_[i]->Fill(l2info.ECALClusterPhiRMS);
00868                             L2ClusterDeltaRRMSRef_[i]->Fill(l2info.ECALClusterDRRMS);
00869                             
00870 
00871                           }
00872 
00873                       }
00874 
00875                     }
00876          }
00877 }
00878 
00879 
00880 
00881 void 
00882 HLTTauDQMSource::doL25(const Event& iEvent, const EventSetup& iSetup)
00883 {
00884 
00885 
00886 
00887           //Access the isolation class and do L25 analysis
00888           Handle<IsolatedTauTagInfoCollection> tauTagInfo;
00889           if(iEvent.getByLabel(l25IsolInfo_, tauTagInfo))
00890             {
00891               for(IsolatedTauTagInfoCollection::const_iterator tauTag  = tauTagInfo->begin();tauTag!=tauTagInfo->end();++tauTag)
00892                 {
00893                   //Fill Inclusive histograms
00894                   L25JetEt_->Fill(tauTag->jet()->et());
00895                   L25JetEta_->Fill(tauTag->jet()->eta());
00896                   L25NPixelTracks_->Fill(tauTag->allTracks().size());
00897                   L25NQPixelTracks_->Fill(tauTag->selectedTracks().size());
00898                   const TrackRef lTrack =tauTag->leadingSignalTrack(); 
00899                   if(!lTrack)
00900                     {
00901                       L25HasLeadingTrack_->Fill(1.5);
00902                     }
00903                   else
00904                     {
00905                       L25HasLeadingTrack_->Fill(0.5);
00906                       L25LeadTrackPt_->Fill(lTrack->pt());
00907 
00908                     }
00909 
00910                   //Calculate Sum of Track pt
00911                   double sumTrackPt = 0.;
00912                   for(size_t k=0;k<tauTag->allTracks().size();++k)
00913                     {
00914                       sumTrackPt+=tauTag->allTracks()[k]->pt();
00915                     }
00916 
00917                   L25SumTrackPt_->Fill(sumTrackPt);
00918 
00919 
00920                   //Fill Matching Information
00921                   for(size_t i=0;i<refFilters_.size();++i)
00922                     {
00923                       //Get reference Objects
00924                       LVColl refObjects = importFilterColl(refFilters_[i],refIDs_[i],iEvent);
00925                       //Match Jet
00926                       if(match(tauTag->jet()->p4(),refObjects,corrDeltaR_,PtCut_[i]))
00927                         {
00928                           L25JetEtRef_[i]->Fill(tauTag->jet()->et());
00929                           L25JetEtaRef_[i]->Fill(tauTag->jet()->eta());
00930                           L25NPixelTracksRef_[i]->Fill(tauTag->allTracks().size());
00931                           L25NQPixelTracksRef_[i]->Fill(tauTag->selectedTracks().size());
00932                                      
00933                           if(!lTrack)
00934                             {
00935                               L25HasLeadingTrackRef_[i]->Fill(1.5);
00936                             }
00937                           else
00938                             {
00939                               L25HasLeadingTrackRef_[i]->Fill(0.5);
00940                               L25LeadTrackPtRef_[i]->Fill(lTrack->pt());
00941                               L25SumTrackPtRef_[i]->Fill(sumTrackPt);
00942                             }
00943                         
00944                         }
00945                     }
00946                 }
00947             }
00948 }             
00949             
00950         
00951 
00952 
00953 void 
00954 HLTTauDQMSource::doL3(const Event& iEvent, const EventSetup& iSetup)
00955 {
00956 
00957 
00958 
00959           //Access the isolation class and do L3 analysis
00960           Handle<IsolatedTauTagInfoCollection> tauTagInfo;
00961           if(iEvent.getByLabel(l3IsolInfo_, tauTagInfo))
00962             {
00963               for(IsolatedTauTagInfoCollection::const_iterator tauTag  = tauTagInfo->begin();tauTag!=tauTagInfo->end();++tauTag)
00964                 {
00965                   //Fill Inclusive histograms
00966                   L3JetEt_->Fill(tauTag->jet()->et());
00967                   L3JetEta_->Fill(tauTag->jet()->eta());
00968                   L3NPixelTracks_->Fill(tauTag->allTracks().size());
00969                   L3NQPixelTracks_->Fill(tauTag->selectedTracks().size());
00970                   const TrackRef lTrack =tauTag->leadingSignalTrack(); 
00971                   if(!lTrack)
00972                     {
00973                       L3HasLeadingTrack_->Fill(1.5);
00974                     }
00975                   else
00976                     {
00977                       L3HasLeadingTrack_->Fill(0.5);
00978                       L3LeadTrackPt_->Fill(lTrack->pt());
00979 
00980                     }
00981 
00982                   //Calculate Sum of Track pt
00983                   double sumTrackPt = 0.;
00984                   for(size_t k=0;k<tauTag->allTracks().size();++k)
00985                     {
00986                       sumTrackPt+=tauTag->allTracks()[k]->pt();
00987                     }
00988 
00989                   L3SumTrackPt_->Fill(sumTrackPt);
00990 
00991 
00992                   //Fill Matching Information
00993                   for(size_t i=0;i<refFilters_.size();++i)
00994                     {
00995                       //Get reference Objects
00996                       LVColl refObjects = importFilterColl(refFilters_[i],refIDs_[i],iEvent);
00997                       //Match Jet
00998                       if(match(tauTag->jet()->p4(),refObjects,corrDeltaR_,PtCut_[i]))
00999                         {
01000                           L3JetEtRef_[i]->Fill(tauTag->jet()->et());
01001                           L3JetEtaRef_[i]->Fill(tauTag->jet()->eta());
01002                           L3NPixelTracksRef_[i]->Fill(tauTag->allTracks().size());
01003                           L3NQPixelTracksRef_[i]->Fill(tauTag->selectedTracks().size());
01004                                      
01005                           if(!lTrack)
01006                             {
01007                               L3HasLeadingTrackRef_[i]->Fill(1.5);
01008                             }
01009                           else
01010                             {
01011                               L3HasLeadingTrackRef_[i]->Fill(0.5);
01012                               L3LeadTrackPtRef_[i]->Fill(lTrack->pt());
01013                               L3SumTrackPtRef_[i]->Fill(sumTrackPt);
01014                             }
01015                         
01016                         }
01017                     }
01018                 }
01019             }
01020 }             
01021             
01022         
01023     
01024 
01025 
01026 
01027 
01028 
01029 
01030 bool 
01031 HLTTauDQMSource::match(const LV& cand,const  LVColl&  electrons/*VRelectron& electrons*/,double deltaR,double  ptMin)
01032 {
01033 
01034  
01035   bool matched=false;
01036 
01037   for(size_t i = 0;i<electrons.size();++i)
01038       {
01039         double delta = ROOT::Math::VectorUtil::DeltaR(cand.Vect(),electrons[i].Vect());
01040         if((delta<deltaR)&&electrons[i].Pt()>ptMin)
01041           {
01042             matched=true;
01043           }
01044       }
01045 
01046   return matched;
01047 
01048 
01049 
01050 }
01051 
01052 
01053 std::vector<double> 
01054 HLTTauDQMSource::calcEfficiency(int num,int denom)
01055 {
01056   std::vector<double> a;
01057 
01058   if(denom==0)
01059     {
01060       a.push_back(0.);
01061       a.push_back(0.);
01062     }
01063   else
01064     {    
01065       a.push_back(((double)num)/((double)denom));
01066       a.push_back(sqrt(a[0]*(1-a[0])/((double)denom)));
01067     }
01068   return a;
01069 }
01070 
01071 LVColl 
01072 HLTTauDQMSource::importObjectColl(edm::InputTag& filter,int id,const Event& iEvent)
01073 {
01074       //Create output Collection
01075       LVColl out;
01076 
01077       //Look at all Different triggers
01078       
01079       //If we have a L1 Jet
01080       if(id==trigger::TriggerL1CenJet||id==trigger::TriggerL1ForJet||id==trigger::TriggerL1TauJet) 
01081         {
01082           edm::Handle<trigger::TriggerFilterObjectWithRefs> f;
01083           if(iEvent.getByLabel(filter,f))
01084             {
01085               VRl1jet jets; 
01086               f->getObjects(trigger::TriggerL1TauJet,jets);
01087               for(size_t i = 0; i<jets.size();++i)
01088                 out.push_back(jets[i]->p4());
01089 
01090             }
01091 
01092         }
01093 
01094       //If we have an HLT Jet
01095       if(id==trigger::TriggerTau||id==trigger::TriggerJet||id==trigger::TriggerBJet) 
01096         {
01097           edm::Handle<reco::CaloJetCollection> obj;
01098           if(iEvent.getByLabel(filter,obj))
01099             {
01100               for(size_t i = 0; i<obj->size();++i)
01101                 out.push_back((*obj)[i].p4());
01102 
01103             }
01104 
01105         }
01106 
01107       //If we have a gamma Collection(HLT Jets, Taus and bs)
01108       if(id==trigger::TriggerPhoton) 
01109         {
01110           edm::Handle<reco::RecoEcalCandidateCollection> gamma;
01111           if(iEvent.getByLabel(filter,gamma))
01112             {
01113               for(size_t i = 0; i<gamma->size();++i)
01114                 out.push_back((*gamma)[i].p4());
01115 
01116             }
01117 
01118         }
01119 
01120       //If we have an electron Collection(Electrons)
01121       if(id==trigger::TriggerElectron) 
01122         {
01123           edm::Handle<reco::ElectronCollection> obj;
01124           if(iEvent.getByLabel(filter,obj))
01125             {
01126               for(size_t i = 0; i<obj->size();++i)
01127                 out.push_back((*obj)[i].p4());
01128 
01129             }
01130 
01131         }
01132 
01133       //If we have a Muon  Collection
01134       if(id==trigger::TriggerMuon) 
01135         {
01136           edm::Handle<RecoChargedCandidateCollection> obj;
01137           if(iEvent.getByLabel(filter,obj))
01138             {
01139               for(size_t i = 0; i<obj->size();++i)
01140                 out.push_back((*obj)[i].p4());
01141 
01142             }
01143 
01144         }
01145 
01146       //If we have a Track Collection
01147       if(id==trigger::TriggerTrack) 
01148         {
01149           edm::Handle<std::vector<reco::IsolatedPixelTrackCandidate> > obj;
01150           if(iEvent.getByLabel(filter,obj))
01151             {
01152               for(size_t i = 0; i<obj->size();++i)
01153                 out.push_back((*obj)[i].p4());
01154             }
01155         }
01156 
01157   return out;
01158 }
01159 
01160 
01161 LVColl 
01162 HLTTauDQMSource::importFilterColl(edm::InputTag& filter,int pdgID,const Event& iEvent)
01163 {
01164       //Create output Collection
01165       LVColl out;
01166 
01167       //Look at all Different triggers
01168       Handle<TriggerEvent> handle;
01169       // force the signature such that we don't get an exception here [wittich]
01170       bool ret = iEvent.getByLabel(triggerEvent_,handle);
01171       if ( ! ret ) {
01172         edm::LogInfo("Status") << "couldn't find TriggerEvent.";
01173         return out;
01174       }
01175 
01176       //get All the final trigger objects
01177       const TriggerObjectCollection& TOC(handle->getObjects());
01178       
01179       //filter index
01180       size_t index = handle->filterIndex(filter);
01181       if(index!=handle->sizeFilters())
01182         {
01183           const Keys& KEYS = handle->filterKeys(index);
01184           for(size_t i = 0;i<KEYS.size();++i)
01185             {
01186               const TriggerObject& TO(TOC[KEYS[i]]);
01187               LV a(TO.px(),TO.py(),TO.pz(),TO.energy());
01188               if(abs(TO.id()) == pdgID)
01189                 out.push_back(a);
01190             }
01191 
01192 
01193         }
01194 
01195       return out;
01196 }
01197 
01198 

Generated on Tue Jun 9 17:33:08 2009 for CMSSW by  doxygen 1.5.4