CMS 3D CMS Logo

Public Member Functions | Private Attributes

L1RCTTestAnalyzer Class Reference

#include <src/L1RCTTestAnalyzer/src/L1RCTTestAnalyzer.cc>

Inheritance diagram for L1RCTTestAnalyzer:
edm::EDAnalyzer

List of all members.

Public Member Functions

virtual void analyze (const edm::Event &, const edm::EventSetup &)
 L1RCTTestAnalyzer (const edm::ParameterSet &)
 ~L1RCTTestAnalyzer ()

Private Attributes

edm::InputTag ecalDigisLabel
TH1F * h_ecalTimeSample
TH1F * h_emCandTimeSample
TH1F * h_emIeta
TH1F * h_emIphi
TH1F * h_emIso
TH2F * h_emIsoInIetaIphi
TH2F * h_emNonIsoInIetaIphi
TH1F * h_emRank
TH2F * h_emRankInIetaIphi
TH1F * h_emRankOutOfTime
TH1F * h_hcalTimeSample
TH2F * h_regionFGInIetaIphi
TH1F * h_regionIeta
TH1F * h_regionIphi
TH1F * h_regionMip
TH1F * h_regionSum
TH2F * h_regionSumInIetaIphi
TH1F * h_towerMip
edm::InputTag hcalDigisLabel
std::string m_HepMCProduct
edm::InputTag rctDigisLabel
bool showEmCands
bool showRegionSums

Detailed Description

Description: <one line="" class="" summary>="">

Implementation: <Notes on="" implementation>="">

Definition at line 47 of file L1RCTTestAnalyzer.h.


Constructor & Destructor Documentation

L1RCTTestAnalyzer::L1RCTTestAnalyzer ( const edm::ParameterSet iConfig) [explicit]

Definition at line 27 of file L1RCTTestAnalyzer.cc.

References h_ecalTimeSample, h_emCandTimeSample, h_emIeta, h_emIphi, h_emIso, h_emIsoInIetaIphi, h_emNonIsoInIetaIphi, h_emRank, h_emRankInIetaIphi, h_emRankOutOfTime, h_hcalTimeSample, h_regionFGInIetaIphi, h_regionIeta, h_regionIphi, h_regionMip, h_regionSum, h_regionSumInIetaIphi, and h_towerMip.

                                                                   :
  showEmCands(iConfig.getUntrackedParameter<bool>("showEmCands")),
  showRegionSums(iConfig.getUntrackedParameter<bool>("showRegionSums")),
  ecalDigisLabel(iConfig.getParameter<edm::InputTag>("ecalDigisLabel")),
  hcalDigisLabel(iConfig.getParameter<edm::InputTag>("hcalDigisLabel")),
  rctDigisLabel(iConfig.getParameter<edm::InputTag>("rctDigisLabel"))
{
   //now do what ever initialization is needed

  edm::Service<TFileService> fs;
  h_emRank = fs->make<TH1F>( "emRank", "emRank", 64, 0., 64. );
  h_emRankOutOfTime = fs->make<TH1F>( "emRankOutOfTime", "emRankOutOfTime",
                                      64, 0., 64. );
  h_emIeta = fs->make<TH1F>( "emIeta", "emIeta", 22, 0., 22. );
  h_emIphi = fs->make<TH1F>( "emIphi", "emIphi", 18, 0., 18. );
  h_emIso = fs->make<TH1F>( "emIso", "emIso", 2, 0., 2. );
  h_emRankInIetaIphi = fs->make<TH2F>( "emRank2D", "emRank2D", 22, 0., 22.,
                                       18, 0., 18. );
  h_emIsoInIetaIphi = fs->make<TH2F>( "emIso2D", "emIso2D", 22, 0., 22.,
                                      18, 0., 18. );
  h_emNonIsoInIetaIphi = fs->make<TH2F>( "emNonIso2D", "emNonIso2D", 22, 0., 
                                         22., 18, 0., 18. );
  h_emCandTimeSample = fs->make<TH1F>( "emCandTimeSample", "emCandTimeSample",
                                       5, -2., 2.);

  h_regionSum = fs->make<TH1F>( "regionSum", "regionSum", 100, 0., 100. );
  h_regionIeta = fs->make<TH1F>( "regionIeta", "regionIeta", 22, 0., 22. );
  h_regionIphi = fs->make<TH1F>( "regionIphi", "regionIphi", 18, 0., 18. );
  h_regionMip = fs->make<TH1F>( "regionMip", "regionMipBit", 2, 0., 2. );
  h_regionSumInIetaIphi = fs->make<TH2F>( "regionSum2D", "regionSum2D", 22, 
                                          0., 22., 18, 0., 18. );
  h_regionFGInIetaIphi = fs->make<TH2F>( "regionFG2D", "regionFG2D", 22, 0.,
                                         22., 18, 0., 18. );

  h_towerMip = fs->make<TH1F>( "towerMip", "towerMipBit", 2, 0., 2. );

  h_ecalTimeSample = fs->make<TH1F>( "ecalTimeSample", "ecalTimeSample",
                                     10, 0., 10. );
  h_hcalTimeSample = fs->make<TH1F>( "hcalTimeSample", "hcalTimeSample",
                                     10, 0., 10. );

  // get names of modules, producing object collections
}
L1RCTTestAnalyzer::~L1RCTTestAnalyzer ( )

Definition at line 72 of file L1RCTTestAnalyzer.cc.

{

   // do anything here that needs to be done at destruction time
   // (e.g. close files, deallocate resources etc.)

}

Member Function Documentation

void L1RCTTestAnalyzer::analyze ( const edm::Event iEvent,
const edm::EventSetup iSetup 
) [virtual]

Implements edm::EDAnalyzer.

Definition at line 87 of file L1RCTTestAnalyzer.cc.

References gather_cfg::cout, patCandidatesForDimuonsSequences_cff::ecal, ecalDigisLabel, edm::EventSetup::get(), edm::Event::getByLabel(), h_ecalTimeSample, h_emCandTimeSample, h_emIeta, h_emIphi, h_emIso, h_emIsoInIetaIphi, h_emNonIsoInIetaIphi, h_emRank, h_emRankInIetaIphi, h_emRankOutOfTime, h_hcalTimeSample, h_regionFGInIetaIphi, h_regionIeta, h_regionIphi, h_regionMip, h_regionSum, h_regionSumInIetaIphi, h_towerMip, patCandidatesForDimuonsSequences_cff::hcal, hcalDigisLabel, rctDigisLabel, showEmCands, and showRegionSums.

{
   using namespace edm;
#ifdef THIS_IS_AN_EVENT_EXAMPLE
   Handle<ExampleData> pIn;
   iEvent.getByLabel("example",pIn);
#endif

#ifdef THIS_IS_AN_EVENTSETUP_EXAMPLE
   ESHandle<SetupData> pSetup;
   iSetup.get<SetupRecord>().get(pSetup);
#endif

   // as in L1GctTestAnalyzer.cc
   Handle<L1CaloEmCollection> rctEmCands;
   Handle<L1CaloRegionCollection> rctRegions;
   Handle<EcalTrigPrimDigiCollection> ecalColl;
   Handle<HcalTrigPrimDigiCollection> hcalColl;

   L1CaloEmCollection::const_iterator em;
   L1CaloRegionCollection::const_iterator rgn;
   EcalTrigPrimDigiCollection::const_iterator ecal;
   HcalTrigPrimDigiCollection::const_iterator hcal;

   iEvent.getByLabel(rctDigisLabel, rctEmCands);
   iEvent.getByLabel(rctDigisLabel, rctRegions);
   iEvent.getByLabel(ecalDigisLabel, ecalColl);
   iEvent.getByLabel(hcalDigisLabel, hcalColl);

   for (ecal=ecalColl->begin(); ecal!=ecalColl->end(); ecal++)
     {
       for (unsigned short sample = 0; sample < (*ecal).size(); sample++)
         {
           h_ecalTimeSample->Fill(sample);
         }
     }

   for (hcal=hcalColl->begin(); hcal!=hcalColl->end(); hcal++)
     {
       h_towerMip->Fill( (*hcal).SOI_fineGrain() );
       for (unsigned short sample = 0; sample < (*hcal).size(); sample++)
         {
           h_hcalTimeSample->Fill(sample);
         }
     }

   if(showEmCands)
     {
       std::cout << std::endl << "L1 RCT EmCand objects" << std::endl;
     }
   for (em=rctEmCands->begin(); em!=rctEmCands->end(); em++){
     //  std::cout << "(Analyzer)\n" << (*em) << std::endl;
     h_emCandTimeSample->Fill((*em).bx());
     if ((*em).bx() == 0)
       {
         unsigned short n_emcands = 0;
         //std::cout << std::endl << "rank: " << (*em).rank() ;
         
         if ((*em).rank() > 0)
           {
             h_emRank->Fill( (*em).rank() );
             h_emIeta->Fill( (*em).regionId().ieta() );
             h_emIphi->Fill( (*em).regionId().iphi() );
             h_emIso->Fill( (*em).isolated() );
             h_emRankInIetaIphi->Fill( (*em).regionId().ieta(), 
                                       (*em).regionId().iphi(),
                                       (*em).rank() );
             if ((*em).isolated())
               {
                 h_emIsoInIetaIphi->Fill( (*em).regionId().ieta(),
                                          (*em).regionId().iphi() );
               }
             else
               {
                 h_emNonIsoInIetaIphi->Fill( (*em).regionId().ieta(),
                                             (*em).regionId().iphi() );
               }
           }
         
         if (showEmCands)
           {
             if ((*em).rank() > 0)
               {
                 std::cout << std::endl << "rank: " << (*em).rank();
                 unsigned short rgnPhi = 999;
                 unsigned short rgn = (unsigned short) (*em).rctRegion();
                 unsigned short card = (unsigned short) (*em).rctCard();
                 unsigned short crate = (unsigned short) (*em).rctCrate();
                 
                 if (card == 6)
                   {
                     rgnPhi = rgn;
                   }
                 else if (card < 6)
                   {
                     rgnPhi = (card % 2);
                   }
                 else 
                   {
                     std::cout << "rgnPhi not assigned (still " << rgnPhi << ") -- Weird card number! " << card ;
                   }
                 unsigned short phi_bin = ((crate % 9) * 2) + rgnPhi;
                 short eta_bin = (card/2) * 2 + 1;
                 if (card < 6)
                   {
                     eta_bin = eta_bin + rgn;
                   }
                 if (crate < 9)
                   {
                     eta_bin = -eta_bin;
                   }
                 n_emcands++;
                 
                   std::cout << /* "rank: " << (*em).rank() << */ "  eta_bin: " << eta_bin << "  phi_bin: " << phi_bin << ".  crate: " << crate << "  card: " << card << "  region: " << rgn << ".  isolated: " << (*em).isolated();
               }
           }
       }
     else
       {
         h_emRankOutOfTime->Fill( (*em).rank() );
       }
   }
   if(showEmCands)
     {
       std::cout << std::endl;
     }

   if(showRegionSums)
     {
       std::cout << "Regions" << std::endl;
     }
   for (rgn=rctRegions->begin(); rgn!=rctRegions->end(); rgn++)
     {
       if ((*rgn).bx() == 0)
         {
           if(showRegionSums&&(*rgn).et()>0)
             {
               std::cout << /* "(Analyzer)\n" << */ (*rgn) << std::endl;
             }
           if ( (*rgn).et() > 0 )
             {
               h_regionSum->Fill( (*rgn).et() );
               h_regionIeta->Fill( (*rgn).gctEta() );
               h_regionIphi->Fill( (*rgn).gctPhi() );
               h_regionSumInIetaIphi->Fill( (*rgn).gctEta(), (*rgn).gctPhi(),
                                            (*rgn).et() );
               h_regionFGInIetaIphi->Fill( (*rgn).gctEta(), (*rgn).gctPhi(),
                                           (*rgn).fineGrain() );
             }
           h_regionMip->Fill( (*rgn).mip() );
         }
     }
   if(showRegionSums)
     {
       std::cout << std::endl;
     }

}

Member Data Documentation

Definition at line 59 of file L1RCTTestAnalyzer.h.

Referenced by analyze().

Definition at line 85 of file L1RCTTestAnalyzer.h.

Referenced by analyze(), and L1RCTTestAnalyzer().

Definition at line 72 of file L1RCTTestAnalyzer.h.

Referenced by analyze(), and L1RCTTestAnalyzer().

TH1F* L1RCTTestAnalyzer::h_emIeta [private]

Definition at line 65 of file L1RCTTestAnalyzer.h.

Referenced by analyze(), and L1RCTTestAnalyzer().

TH1F* L1RCTTestAnalyzer::h_emIphi [private]

Definition at line 66 of file L1RCTTestAnalyzer.h.

Referenced by analyze(), and L1RCTTestAnalyzer().

TH1F* L1RCTTestAnalyzer::h_emIso [private]

Definition at line 67 of file L1RCTTestAnalyzer.h.

Referenced by analyze(), and L1RCTTestAnalyzer().

Definition at line 70 of file L1RCTTestAnalyzer.h.

Referenced by analyze(), and L1RCTTestAnalyzer().

Definition at line 71 of file L1RCTTestAnalyzer.h.

Referenced by analyze(), and L1RCTTestAnalyzer().

TH1F* L1RCTTestAnalyzer::h_emRank [private]

Definition at line 63 of file L1RCTTestAnalyzer.h.

Referenced by analyze(), and L1RCTTestAnalyzer().

Definition at line 68 of file L1RCTTestAnalyzer.h.

Referenced by analyze(), and L1RCTTestAnalyzer().

Definition at line 64 of file L1RCTTestAnalyzer.h.

Referenced by analyze(), and L1RCTTestAnalyzer().

Definition at line 86 of file L1RCTTestAnalyzer.h.

Referenced by analyze(), and L1RCTTestAnalyzer().

Definition at line 81 of file L1RCTTestAnalyzer.h.

Referenced by analyze(), and L1RCTTestAnalyzer().

Definition at line 75 of file L1RCTTestAnalyzer.h.

Referenced by analyze(), and L1RCTTestAnalyzer().

Definition at line 76 of file L1RCTTestAnalyzer.h.

Referenced by analyze(), and L1RCTTestAnalyzer().

Definition at line 77 of file L1RCTTestAnalyzer.h.

Referenced by analyze(), and L1RCTTestAnalyzer().

Definition at line 74 of file L1RCTTestAnalyzer.h.

Referenced by analyze(), and L1RCTTestAnalyzer().

Definition at line 78 of file L1RCTTestAnalyzer.h.

Referenced by analyze(), and L1RCTTestAnalyzer().

Definition at line 83 of file L1RCTTestAnalyzer.h.

Referenced by analyze(), and L1RCTTestAnalyzer().

Definition at line 60 of file L1RCTTestAnalyzer.h.

Referenced by analyze().

std::string L1RCTTestAnalyzer::m_HepMCProduct [private]

Definition at line 56 of file L1RCTTestAnalyzer.h.

Definition at line 61 of file L1RCTTestAnalyzer.h.

Referenced by analyze().

Definition at line 57 of file L1RCTTestAnalyzer.h.

Referenced by analyze().

Definition at line 58 of file L1RCTTestAnalyzer.h.

Referenced by analyze().