CMS 3D CMS Logo

CSCTFanalyzer Class Reference

#include <L1Trigger/CSCTrackFinder/plugins/CSCTFanalyzer.h>

Inheritance diagram for CSCTFanalyzer:

edm::EDAnalyzer

List of all members.

Public Member Functions

virtual void analyze (edm::Event const &e, edm::EventSetup const &iSetup)
virtual void beginJob (edm::EventSetup const &)
 CSCTFanalyzer (edm::ParameterSet const &pset)
virtual void endJob (void)
virtual ~CSCTFanalyzer (void)

Private Attributes

edm::InputTag dataTrackProducer
int dbx1
int dbx2
int dbx3
int dch1
int dch2
int dch3
int deta1
int deta2
int deta3
int dphi1
int dphi2
int dphi3
int dpt1
int dpt2
int dpt3
int ebx1
int ebx2
int ebx3
int ech1
int ech2
int ech3
int eeta1
int eeta2
int eeta3
edm::InputTag emulTrackProducer
int ephi1
int ephi2
int ephi3
int ept1
int ept2
int ept3
TFile * file
edm::InputTag lctProducer
int nDataMuons
int nEmulMuons
TTree * tree
int verbose


Detailed Description

Definition at line 15 of file CSCTFanalyzer.h.


Constructor & Destructor Documentation

CSCTFanalyzer::CSCTFanalyzer ( edm::ParameterSet const &  pset  )  [explicit]

Definition at line 5 of file CSCTFanalyzer.cc.

References dataTrackProducer, dbx1, dbx2, dbx3, dch1, dch2, dch3, deta1, deta2, deta3, dphi1, dphi2, dphi3, dpt1, dpt2, dpt3, ebx1, ebx2, ebx3, ech1, ech2, ech3, eeta1, eeta2, eeta3, emulTrackProducer, ephi1, ephi2, ephi3, ept1, ept2, ept3, file, edm::ParameterSet::getUntrackedParameter(), lctProducer, nDataMuons, nEmulMuons, and tree.

00005                                                        :edm::EDAnalyzer(){
00006         verbose           = pset.getUntrackedParameter<unsigned  int>("verbose",0);
00007         dataTrackProducer = pset.getUntrackedParameter<edm::InputTag>("dataTrackProducer",edm::InputTag("csctfDigis"));
00008         emulTrackProducer = pset.getUntrackedParameter<edm::InputTag>("emulTrackProducer",edm::InputTag("csctfTrackDigis"));
00009         lctProducer       = pset.getUntrackedParameter<edm::InputTag>("lctProducer",edm::InputTag("csctfDigis"));
00010         file = new TFile("qwe.root","RECREATE");
00011         tree = new TTree("dy","QWE");
00012         tree->Branch("nDataMuons", &nDataMuons, "nDataMuons/I");
00013         tree->Branch("dphi1", &dphi1, "dphi1/I");
00014         tree->Branch("dphi2", &dphi2, "dphi2/I");
00015         tree->Branch("dphi3", &dphi3, "dphi3/I");
00016         tree->Branch("deta1", &deta1, "deta1/I");
00017         tree->Branch("deta2", &deta2, "deta2/I");
00018         tree->Branch("deta3", &deta3, "deta3/I");
00019         tree->Branch("dpt1",  &dpt1,  "dpt1/I");
00020         tree->Branch("dpt2",  &dpt2,  "dpt2/I");
00021         tree->Branch("dpt3",  &dpt3,  "dpt3/I");
00022         tree->Branch("dch1",  &dch1,  "dch1/I");
00023         tree->Branch("dch2",  &dch2,  "dch2/I");
00024         tree->Branch("dch3",  &dch3,  "dch3/I");
00025         tree->Branch("dbx1",  &dbx1,  "dbx1/I");
00026         tree->Branch("dbx2",  &dbx2,  "dbx2/I");
00027         tree->Branch("dbx3",  &dbx3,  "dbx3/I");
00028 
00029         tree->Branch("nEmulMuons", &nEmulMuons, "nEmulMuons/I");
00030         tree->Branch("ephi1", &ephi1, "ephi1/I");
00031         tree->Branch("ephi2", &ephi2, "ephi2/I");
00032         tree->Branch("ephi3", &ephi3, "ephi3/I");
00033         tree->Branch("eeta1", &eeta1, "eeta1/I");
00034         tree->Branch("eeta2", &eeta2, "eeta2/I");
00035         tree->Branch("eeta3", &eeta3, "eeta3/I");
00036         tree->Branch("ept1",  &ept1,  "ept1/I");
00037         tree->Branch("ept2",  &ept2,  "ept2/I");
00038         tree->Branch("ept3",  &ept3,  "ept3/I");
00039         tree->Branch("ech1",  &ech1,  "ech1/I");
00040         tree->Branch("ech2",  &ech2,  "ech2/I");
00041         tree->Branch("ech3",  &ech3,  "ech3/I");
00042         tree->Branch("ebx1",  &ebx1,  "ebx1/I");
00043         tree->Branch("ebx2",  &ebx2,  "ebx2/I");
00044         tree->Branch("ebx3",  &ebx3,  "ebx3/I");
00045 
00046 }

virtual CSCTFanalyzer::~CSCTFanalyzer ( void   )  [inline, virtual]

Definition at line 34 of file CSCTFanalyzer.h.

00034 {}


Member Function Documentation

void CSCTFanalyzer::analyze ( edm::Event const &  e,
edm::EventSetup const &  iSetup 
) [virtual]

Implements edm::EDAnalyzer.

Definition at line 54 of file CSCTFanalyzer.cc.

References GenMuonPlsPt100GeV_cfg::cout, dataTrackProducer, dbx1, dbx2, dbx3, dch1, dch2, dch3, deta1, deta2, deta3, dphi1, dphi2, dphi3, dpt1, dpt2, dpt3, ebx1, ebx2, ebx3, ech1, ech2, ech3, eeta1, eeta2, eeta3, emulTrackProducer, lat::endl(), ephi1, ephi2, ephi3, ept1, ept2, ept3, edm::Event::getByLabel(), edm::InputTag::instance(), edm::InputTag::label(), lctProducer, nDataMuons, nEmulMuons, edm::Handle< T >::product(), tracks, tree, and CSCTriggerNumbering::triggerSubSectorFromLabels().

00054                                                                      {
00055         if( lctProducer.label() != "null" ){
00056                 edm::Handle<CSCCorrelatedLCTDigiCollection> LCTs;
00057                 e.getByLabel(lctProducer.label(),lctProducer.instance(), LCTs);
00058 
00059                 for(CSCCorrelatedLCTDigiCollection::DigiRangeIterator csc=LCTs.product()->begin(); csc!=LCTs.product()->end(); csc++){
00060                         int lctId=0;
00061 
00062                         CSCCorrelatedLCTDigiCollection::Range range1 = LCTs.product()->get((*csc).first);
00063                         for(CSCCorrelatedLCTDigiCollection::const_iterator lct=range1.first; lct!=range1.second; lct++,lctId++){
00064                                 int station = (*csc).first.station()-1;
00065                                 int cscId   = (*csc).first.triggerCscId()-1;
00066                                 int sector  = (*csc).first.triggerSector()-1 + ( (*csc).first.endcap()==1 ? 0 : 6 );
00067                                 int subSector = CSCTriggerNumbering::triggerSubSectorFromLabels((*csc).first);
00068                                 int tbin    = lct->getBX();
00069                                 int fpga    = ( subSector ? subSector-1 : station+1 );
00070                                 if((verbose&1)==1)
00071                                         std::cout<<"LCT in station="<<(station+1)<<" sector="<<(sector+1)<<" cscId="<<(cscId+1)<<" bx="<<tbin<<std::endl;
00072                         }
00073                 }
00074         }
00075 
00076         nDataMuons = 0; nEmulMuons = 0;
00077         dphi1=-1; deta1=-1; dpt1=-1; dch1=-1, dbx1=-10;
00078         dphi2=-1; deta2=-1; dpt2=-1; dch2=-1, dbx2=-10;
00079         dphi3=-1; deta3=-1; dpt3=-1; dch3=-1, dbx3=-10;
00080         ephi1=-1; eeta1=-1; ept1=-1; ech1=-1, ebx1=-10;
00081         ephi2=-1; eeta2=-1; ept2=-1; ech2=-1, ebx2=-10;
00082         ephi3=-1; eeta3=-1; ept3=-1; ech3=-1, ebx3=-10;
00083 
00084         if( dataTrackProducer.label() != "null" ){
00085                 edm::Handle<L1CSCTrackCollection> tracks;
00086                 e.getByLabel(dataTrackProducer.label(),dataTrackProducer.instance(),tracks);
00087                 for(L1CSCTrackCollection::const_iterator trk=tracks.product()->begin(); trk!=tracks.product()->end(); trk++){
00088                         switch(nDataMuons){
00089                                 case 0:
00090                                         dphi1 = trk->first.localPhi();
00091                                         deta1 = trk->first.eta_packed();
00092                                         dpt1  = trk->first.pt_packed();
00093                                         dch1  = trk->first.charge_packed();
00094                                         dbx1  = trk->first.BX();
00095                                 break;
00096                                 case 1:
00097                                         dphi2 = trk->first.localPhi();
00098                                         deta2 = trk->first.eta_packed();
00099                                         dpt2  = trk->first.pt_packed();
00100                                         dch2  = trk->first.charge_packed();
00101                                         dbx2  = trk->first.BX();
00102                                 break;
00103                                 case 2:
00104                                         dphi3 = trk->first.localPhi();
00105                                         deta3 = trk->first.eta_packed();
00106                                         dpt3  = trk->first.pt_packed();
00107                                         dch3  = trk->first.charge_packed();
00108                                         dbx3  = trk->first.BX();
00109                                 break;
00110                                 default: break;
00111                         }
00112                         if( (verbose&2)==2 )
00113                                 std::cout<<"Data: TRK in endcap="<<trk->first.endcap()<<" sector="<<trk->first.sector()<<" bx="<<trk->first.BX()
00114                                         <<" (rank="<<trk->first.rank()
00115                                         <<" localPhi="<<trk->first.localPhi()
00116                                         <<" me1D="<<trk->first.me1ID()
00117                                         <<" me2D="<<trk->first.me2ID()
00118                                         <<" me3D="<<trk->first.me3ID()
00119                                         <<" me4D="<<trk->first.me4ID()
00120                                         <<" mb1D="<<trk->first.mb1ID()
00121                                         <<")"<<std::endl;
00122                         nDataMuons++;
00123                 }
00124         }
00125 
00126         if( emulTrackProducer.label() != "null" ){
00127                 edm::Handle<L1CSCTrackCollection> tracks;
00128                 e.getByLabel(emulTrackProducer.label(),emulTrackProducer.instance(),tracks);
00129                 for(L1CSCTrackCollection::const_iterator trk=tracks.product()->begin(); trk!=tracks.product()->end(); trk++){
00130                         switch(nEmulMuons){
00131                                 case 0:
00132                                         ephi1 = trk->first.localPhi();
00133                                         eeta1 = trk->first.eta_packed();
00134                                         ept1  = trk->first.pt_packed();
00135                                         ech1  = trk->first.charge_packed();
00136                                         ebx1  = trk->first.BX();
00137                                 break;
00138                                 case 1:
00139                                         ephi2 = trk->first.localPhi();
00140                                         eeta2 = trk->first.eta_packed();
00141                                         ept2  = trk->first.pt_packed();
00142                                         ech2  = trk->first.charge_packed();
00143                                         ebx2  = trk->first.BX();
00144                                 break;
00145                                 case 2:
00146                                         ephi3 = trk->first.localPhi();
00147                                         eeta3 = trk->first.eta_packed();
00148                                         ept3  = trk->first.pt_packed();
00149                                         ech3  = trk->first.charge_packed();
00150                                         ebx3  = trk->first.BX();
00151                                 break;
00152                                 default: break;
00153                         }
00154                         if( (verbose&2)==2 )
00155                                 std::cout<<"Emulator: TRK in endcap="<<trk->first.endcap()<<" sector="<<trk->first.sector()<<" bx="<<trk->first.BX()
00156                                         <<" (rank="<<trk->first.rank()
00157                                         <<" localPhi="<<trk->first.localPhi()
00158                                         <<" me1D="<<trk->first.me1ID()
00159                                         <<" me2D="<<trk->first.me2ID()
00160                                         <<" me3D="<<trk->first.me3ID()
00161                                         <<" me4D="<<trk->first.me4ID()
00162                                         <<" mb1D="<<trk->first.mb1ID()
00163                                         <<")"<<std::endl;
00164                         nEmulMuons++;
00165                 }
00166         }
00167 
00168         tree->Fill();
00169 }

virtual void CSCTFanalyzer::beginJob ( edm::EventSetup const &   )  [inline, virtual]

Reimplemented from edm::EDAnalyzer.

Definition at line 31 of file CSCTFanalyzer.h.

00031 {}

void CSCTFanalyzer::endJob ( void   )  [virtual]

Reimplemented from edm::EDAnalyzer.

Definition at line 48 of file CSCTFanalyzer.cc.

References file, and tree.

00048                               {
00049         tree->Write();
00050         file->Write();
00051         file->Close();
00052 }


Member Data Documentation

edm::InputTag CSCTFanalyzer::dataTrackProducer [private]

Definition at line 17 of file CSCTFanalyzer.h.

Referenced by analyze(), and CSCTFanalyzer().

int CSCTFanalyzer::dbx1 [private]

Definition at line 21 of file CSCTFanalyzer.h.

Referenced by analyze(), and CSCTFanalyzer().

int CSCTFanalyzer::dbx2 [private]

Definition at line 22 of file CSCTFanalyzer.h.

Referenced by analyze(), and CSCTFanalyzer().

int CSCTFanalyzer::dbx3 [private]

Definition at line 23 of file CSCTFanalyzer.h.

Referenced by analyze(), and CSCTFanalyzer().

int CSCTFanalyzer::dch1 [private]

Definition at line 21 of file CSCTFanalyzer.h.

Referenced by analyze(), and CSCTFanalyzer().

int CSCTFanalyzer::dch2 [private]

Definition at line 22 of file CSCTFanalyzer.h.

Referenced by analyze(), and CSCTFanalyzer().

int CSCTFanalyzer::dch3 [private]

Definition at line 23 of file CSCTFanalyzer.h.

Referenced by analyze(), and CSCTFanalyzer().

int CSCTFanalyzer::deta1 [private]

Definition at line 21 of file CSCTFanalyzer.h.

Referenced by analyze(), and CSCTFanalyzer().

int CSCTFanalyzer::deta2 [private]

Definition at line 22 of file CSCTFanalyzer.h.

Referenced by analyze(), and CSCTFanalyzer().

int CSCTFanalyzer::deta3 [private]

Definition at line 23 of file CSCTFanalyzer.h.

Referenced by analyze(), and CSCTFanalyzer().

int CSCTFanalyzer::dphi1 [private]

Definition at line 21 of file CSCTFanalyzer.h.

Referenced by analyze(), and CSCTFanalyzer().

int CSCTFanalyzer::dphi2 [private]

Definition at line 22 of file CSCTFanalyzer.h.

Referenced by analyze(), and CSCTFanalyzer().

int CSCTFanalyzer::dphi3 [private]

Definition at line 23 of file CSCTFanalyzer.h.

Referenced by analyze(), and CSCTFanalyzer().

int CSCTFanalyzer::dpt1 [private]

Definition at line 21 of file CSCTFanalyzer.h.

Referenced by analyze(), and CSCTFanalyzer().

int CSCTFanalyzer::dpt2 [private]

Definition at line 22 of file CSCTFanalyzer.h.

Referenced by analyze(), and CSCTFanalyzer().

int CSCTFanalyzer::dpt3 [private]

Definition at line 23 of file CSCTFanalyzer.h.

Referenced by analyze(), and CSCTFanalyzer().

int CSCTFanalyzer::ebx1 [private]

Definition at line 24 of file CSCTFanalyzer.h.

Referenced by analyze(), and CSCTFanalyzer().

int CSCTFanalyzer::ebx2 [private]

Definition at line 25 of file CSCTFanalyzer.h.

Referenced by analyze(), and CSCTFanalyzer().

int CSCTFanalyzer::ebx3 [private]

Definition at line 26 of file CSCTFanalyzer.h.

Referenced by analyze(), and CSCTFanalyzer().

int CSCTFanalyzer::ech1 [private]

Definition at line 24 of file CSCTFanalyzer.h.

Referenced by analyze(), and CSCTFanalyzer().

int CSCTFanalyzer::ech2 [private]

Definition at line 25 of file CSCTFanalyzer.h.

Referenced by analyze(), and CSCTFanalyzer().

int CSCTFanalyzer::ech3 [private]

Definition at line 26 of file CSCTFanalyzer.h.

Referenced by analyze(), and CSCTFanalyzer().

int CSCTFanalyzer::eeta1 [private]

Definition at line 24 of file CSCTFanalyzer.h.

Referenced by analyze(), and CSCTFanalyzer().

int CSCTFanalyzer::eeta2 [private]

Definition at line 25 of file CSCTFanalyzer.h.

Referenced by analyze(), and CSCTFanalyzer().

int CSCTFanalyzer::eeta3 [private]

Definition at line 26 of file CSCTFanalyzer.h.

Referenced by analyze(), and CSCTFanalyzer().

edm::InputTag CSCTFanalyzer::emulTrackProducer [private]

Definition at line 17 of file CSCTFanalyzer.h.

Referenced by analyze(), and CSCTFanalyzer().

int CSCTFanalyzer::ephi1 [private]

Definition at line 24 of file CSCTFanalyzer.h.

Referenced by analyze(), and CSCTFanalyzer().

int CSCTFanalyzer::ephi2 [private]

Definition at line 25 of file CSCTFanalyzer.h.

Referenced by analyze(), and CSCTFanalyzer().

int CSCTFanalyzer::ephi3 [private]

Definition at line 26 of file CSCTFanalyzer.h.

Referenced by analyze(), and CSCTFanalyzer().

int CSCTFanalyzer::ept1 [private]

Definition at line 24 of file CSCTFanalyzer.h.

Referenced by analyze(), and CSCTFanalyzer().

int CSCTFanalyzer::ept2 [private]

Definition at line 25 of file CSCTFanalyzer.h.

Referenced by analyze(), and CSCTFanalyzer().

int CSCTFanalyzer::ept3 [private]

Definition at line 26 of file CSCTFanalyzer.h.

Referenced by analyze(), and CSCTFanalyzer().

TFile* CSCTFanalyzer::file [private]

Definition at line 19 of file CSCTFanalyzer.h.

Referenced by CSCTFanalyzer(), and endJob().

edm::InputTag CSCTFanalyzer::lctProducer [private]

Definition at line 17 of file CSCTFanalyzer.h.

Referenced by analyze(), and CSCTFanalyzer().

int CSCTFanalyzer::nDataMuons [private]

Definition at line 20 of file CSCTFanalyzer.h.

Referenced by analyze(), and CSCTFanalyzer().

int CSCTFanalyzer::nEmulMuons [private]

Definition at line 20 of file CSCTFanalyzer.h.

Referenced by analyze(), and CSCTFanalyzer().

TTree* CSCTFanalyzer::tree [private]

Definition at line 18 of file CSCTFanalyzer.h.

Referenced by analyze(), CSCTFanalyzer(), and endJob().

int CSCTFanalyzer::verbose [private]

Definition at line 20 of file CSCTFanalyzer.h.


The documentation for this class was generated from the following files:
Generated on Tue Jun 9 18:17:29 2009 for CMSSW by  doxygen 1.5.4