Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:19:58

0001 //-------------------------------------------------
0002 //
0003 //   Class: L1MuGMTTree
0004 //
0005 //   Description:   Build GMT tree
0006 //
0007 //
0008 //
0009 //   I. Mikulec            HEPHY Vienna
0010 //
0011 //--------------------------------------------------
0012 
0013 //-----------------------
0014 // This Class's Header --
0015 //-----------------------
0016 #include "L1Trigger/GlobalMuonTrigger/test/L1MuGMTTree.h"
0017 
0018 //---------------
0019 // C++ Headers --
0020 //---------------
0021 
0022 #include <iostream>
0023 #include <iomanip>
0024 #include <vector>
0025 #include <cmath>
0026 
0027 //-------------------------------
0028 // Collaborating Class Headers --
0029 //-------------------------------
0030 #include "TROOT.h"
0031 #include "TTree.h"
0032 #include "TFile.h"
0033 
0034 #include "FWCore/Framework/interface/Frameworkfwd.h"
0035 #include "FWCore/Framework/interface/ESHandle.h"
0036 #include "FWCore/MessageLogger/interface/MessageLogger.h"
0037 #include "SimDataFormats/Vertex/interface/SimVertexContainer.h"
0038 #include "SimDataFormats/Track/interface/SimTrackContainer.h"
0039 #include "SimDataFormats/GeneratorProducts/interface/HepMCProduct.h"
0040 #include "HepMC/GenEvent.h"
0041 
0042 #include "DataFormats/L1GlobalTrigger/interface/L1GlobalTriggerEvmReadoutRecord.h"
0043 #include "DataFormats/L1GlobalTrigger/interface/L1GlobalTriggerReadoutRecord.h"
0044 #include "DataFormats/L1GlobalTrigger/interface/L1GtPsbWord.h"
0045 
0046 #include "DataFormats/FEDRawData/interface/FEDRawDataCollection.h"
0047 #include "DataFormats/FEDRawData/interface/FEDHeader.h"
0048 
0049 using namespace std;
0050 
0051 //----------------
0052 // Constructors --
0053 //----------------
0054 L1MuGMTTree::L1MuGMTTree(const edm::ParameterSet& ps) : m_file(0), m_tree(0) {
0055   m_GMTInputTag = ps.getParameter<edm::InputTag>("GMTInputTag");
0056   m_GTEvmInputTag = ps.getParameter<edm::InputTag>("GTEvmInputTag");
0057   m_GTInputTag = ps.getParameter<edm::InputTag>("GTInputTag");
0058   m_GeneratorInputTag = ps.getParameter<edm::InputTag>("GeneratorInputTag");
0059   m_SimulationInputTag = ps.getParameter<edm::InputTag>("SimulationInputTag");
0060 
0061   m_PhysVal = ps.getParameter<bool>("PhysVal");
0062 
0063   m_outfilename = ps.getUntrackedParameter<string>("OutputFile", "L1MuGMTTree.root");
0064 }
0065 
0066 //--------------
0067 // Destructor --
0068 //--------------
0069 L1MuGMTTree::~L1MuGMTTree() {}
0070 
0071 void L1MuGMTTree::beginJob() {
0072   m_file = TFile::Open(m_outfilename.c_str(), "RECREATE");
0073   m_tree = new TTree("h1", "GMT Tree");
0074   book();
0075 }
0076 
0077 void L1MuGMTTree::endJob() {
0078   m_file->Write();
0079   m_file->Close();
0080 }
0081 
0082 //--------------
0083 // Operations --
0084 //--------------
0085 
0086 void L1MuGMTTree::analyze(const edm::Event& e, const edm::EventSetup& es) {
0087   //
0088   // GENERAL block
0089   //
0090   runn = e.id().run();
0091   eventn = e.id().event();
0092   timest = e.time().value();
0093   bx = e.bunchCrossing();  //overwritten by EVM info until fixed by fw
0094   lumi = e.luminosityBlock();
0095   orbitn = e.orbitNumber();  //overwritten by EVM info until fixed by fw
0096 
0097   //  edm::LogVerbatim("GMTDump") << "run: " << runn << ", event: " << eventn << endl;
0098 
0099   // generetor block
0100   HepMC::GenEvent const* genevent = NULL;
0101 
0102   if (m_GeneratorInputTag.label() != "none") {
0103     edm::Handle<edm::HepMCProduct> vtxSmeared_handle;
0104     e.getByLabel(m_GeneratorInputTag, vtxSmeared_handle);
0105     genevent = vtxSmeared_handle.product()->GetEvent();
0106 
0107     weight = 1.;
0108     if (genevent->weights().size() > 0)
0109       weight = genevent->weights()[0];
0110     pthat = genevent->event_scale();
0111   }
0112 
0113   if (m_SimulationInputTag.label() != "none") {
0114     edm::Handle<edm::SimVertexContainer> simvertices_handle;
0115     e.getByLabel(m_SimulationInputTag, simvertices_handle);
0116     edm::SimVertexContainer const* simvertices = simvertices_handle.product();
0117 
0118     edm::Handle<edm::SimTrackContainer> simtracks_handle;
0119     e.getByLabel(m_SimulationInputTag, simtracks_handle);
0120     edm::SimTrackContainer const* simtracks = simtracks_handle.product();
0121 
0122     edm::SimTrackContainer::const_iterator isimtr;
0123     int igen = 0;
0124     for (isimtr = simtracks->begin(); isimtr != simtracks->end(); isimtr++) {
0125       if (abs((*isimtr).type()) != 13 || igen >= MAXGEN)
0126         continue;
0127       pxgen[igen] = (*isimtr).momentum().px();
0128       pygen[igen] = (*isimtr).momentum().py();
0129       pzgen[igen] = (*isimtr).momentum().pz();
0130       ptgen[igen] = (*isimtr).momentum().pt();
0131       etagen[igen] = (*isimtr).momentum().eta();
0132       phigen[igen] =
0133           (*isimtr).momentum().phi() > 0 ? (*isimtr).momentum().phi() : (*isimtr).momentum().phi() + 2 * 3.14159265359;
0134       chagen[igen] = (*isimtr).type() > 0 ? -1 : 1;
0135       vxgen[igen] = (*simvertices)[(*isimtr).vertIndex()].position().x();
0136       vygen[igen] = (*simvertices)[(*isimtr).vertIndex()].position().y();
0137       vzgen[igen] = (*simvertices)[(*isimtr).vertIndex()].position().z();
0138       pargen[igen] = -1;
0139       //      if(genevent && (*isimtr).genpartIndex()!=-1 && genevent->particle((*isimtr).genpartIndex())->listParents().size()>0) {
0140       //        pargen[igen] = genevent->particle((*isimtr).genpartIndex())->listParents()[0]->pdg_id();
0141       //      }
0142 
0143       igen++;
0144     }
0145     ngen = igen;
0146   }
0147 
0148   // Get GMTReadoutCollection
0149 
0150   if (m_GMTInputTag.label() != "none") {
0151     edm::Handle<L1MuGMTReadoutCollection> gmtrc_handle;
0152     e.getByLabel(m_GMTInputTag, gmtrc_handle);
0153     L1MuGMTReadoutCollection const* gmtrc = gmtrc_handle.product();
0154 
0155     int idt = 0;
0156     int icsc = 0;
0157     int irpcb = 0;
0158     int irpcf = 0;
0159     int igmt = 0;
0160     vector<L1MuGMTReadoutRecord> gmt_records = gmtrc->getRecords();
0161     vector<L1MuGMTReadoutRecord>::const_iterator igmtrr;
0162     for (igmtrr = gmt_records.begin(); igmtrr != gmt_records.end(); igmtrr++) {
0163       vector<L1MuRegionalCand>::const_iterator iter1;
0164       vector<L1MuRegionalCand> rmc;
0165       ;
0166 
0167       if (igmtrr->getBxInEvent() == 0) {
0168         bxgmt = igmtrr->getBxNr();
0169       }
0170 
0171       //
0172       // DTBX Trigger
0173       //
0174 
0175       int iidt = 0;
0176       rmc = igmtrr->getDTBXCands();
0177       for (iter1 = rmc.begin(); iter1 != rmc.end(); iter1++) {
0178         if (idt < MAXDTBX && !(*iter1).empty()) {
0179           bxd[idt] = (*iter1).bx();
0180           if (m_PhysVal) {
0181             etad[idt] = float((*iter1).etaValue());
0182             phid[idt] = float((*iter1).phiValue());
0183             ptd[idt] = float((*iter1).ptValue());
0184           } else {
0185             etad[idt] = float((*iter1).eta_packed());
0186             phid[idt] = float((*iter1).phi_packed());
0187             ptd[idt] = float((*iter1).pt_packed());
0188           }
0189           chad[idt] = (*iter1).chargeValue();
0190           if (!(*iter1).chargeValid())
0191             chad[idt] = 0;
0192           etafined[idt] = 0;  // etafined[idt]=(*iter1).fineEtaBit();
0193           quald[idt] = (*iter1).quality();
0194           dwd[idt] = (*iter1).getDataWord();
0195           chd[idt] = iidt;
0196 
0197           idt++;
0198         }
0199         iidt++;
0200       }
0201 
0202       //
0203       // CSC Trigger
0204       //
0205 
0206       rmc = igmtrr->getCSCCands();
0207       for (iter1 = rmc.begin(); iter1 != rmc.end(); iter1++) {
0208         if (icsc < MAXCSC && !(*iter1).empty()) {
0209           bxc[icsc] = (*iter1).bx();
0210           if (m_PhysVal) {
0211             etac[icsc] = (*iter1).etaValue();
0212             phic[icsc] = (*iter1).phiValue();
0213             ptc[icsc] = (*iter1).ptValue();
0214           } else {
0215             etac[icsc] = (*iter1).eta_packed();
0216             phic[icsc] = (*iter1).phi_packed();
0217             ptc[icsc] = (*iter1).pt_packed();
0218           }
0219           chac[icsc] = (*iter1).chargeValue();
0220           if (!(*iter1).chargeValid())
0221             chac[icsc] = 0;
0222           qualc[icsc] = (*iter1).quality();
0223           dwc[icsc] = (*iter1).getDataWord();
0224 
0225           icsc++;
0226         }
0227       }
0228 
0229       //
0230       // RPCb Trigger
0231       //
0232       rmc = igmtrr->getBrlRPCCands();
0233       for (iter1 = rmc.begin(); iter1 != rmc.end(); iter1++) {
0234         if (irpcb < MAXRPC && !(*iter1).empty()) {
0235           bxrb[irpcb] = (*iter1).bx();
0236           if (m_PhysVal) {
0237             etarb[irpcb] = (*iter1).etaValue();
0238             phirb[irpcb] = (*iter1).phiValue();
0239             ptrb[irpcb] = (*iter1).ptValue();
0240           } else {
0241             etarb[irpcb] = (*iter1).eta_packed();
0242             phirb[irpcb] = (*iter1).phi_packed();
0243             ptrb[irpcb] = (*iter1).pt_packed();
0244           }
0245           charb[irpcb] = (*iter1).chargeValue();
0246           if (!(*iter1).chargeValid())
0247             charb[irpcb] = 0;
0248           qualrb[irpcb] = (*iter1).quality();
0249           dwrb[irpcb] = (*iter1).getDataWord();
0250 
0251           irpcb++;
0252         }
0253       }
0254 
0255       //
0256       // RPCf Trigger
0257       //
0258       rmc = igmtrr->getFwdRPCCands();
0259       for (iter1 = rmc.begin(); iter1 != rmc.end(); iter1++) {
0260         if (irpcf < MAXRPC && !(*iter1).empty()) {
0261           bxrf[irpcf] = (*iter1).bx();
0262           if (m_PhysVal) {
0263             etarf[irpcf] = (*iter1).etaValue();
0264             phirf[irpcf] = (*iter1).phiValue();
0265             ptrf[irpcf] = (*iter1).ptValue();
0266           } else {
0267             etarf[irpcf] = (*iter1).eta_packed();
0268             phirf[irpcf] = (*iter1).phi_packed();
0269             ptrf[irpcf] = (*iter1).pt_packed();
0270           }
0271           charf[irpcf] = (*iter1).chargeValue();
0272           if (!(*iter1).chargeValid())
0273             charf[irpcf] = 0;
0274           qualrf[irpcf] = (*iter1).quality();
0275           dwrf[irpcf] = (*iter1).getDataWord();
0276 
0277           irpcf++;
0278         }
0279       }
0280 
0281       //
0282       // GMT Trigger
0283       //
0284 
0285       vector<L1MuGMTExtendedCand>::const_iterator gmt_iter;
0286       vector<L1MuGMTExtendedCand> exc = igmtrr->getGMTCands();
0287       for (gmt_iter = exc.begin(); gmt_iter != exc.end(); gmt_iter++) {
0288         if (igmt < MAXGMT && !(*gmt_iter).empty()) {
0289           bxg[igmt] = (*gmt_iter).bx();
0290           if (m_PhysVal) {
0291             etag[igmt] = (*gmt_iter).etaValue();
0292             phig[igmt] = (*gmt_iter).phiValue();
0293             ptg[igmt] = (*gmt_iter).ptValue();
0294           } else {
0295             etag[igmt] = (*gmt_iter).etaIndex();
0296             phig[igmt] = (*gmt_iter).phiIndex();
0297             ptg[igmt] = (*gmt_iter).ptIndex();
0298           }
0299           chag[igmt] = (*gmt_iter).charge();
0300           if (!(*gmt_iter).charge_valid())
0301             chag[igmt] = 0;
0302           qualg[igmt] = (*gmt_iter).quality();
0303           detg[igmt] = (*gmt_iter).detector();
0304           rankg[igmt] = (*gmt_iter).rank();
0305           isolg[igmt] = (*gmt_iter).isol();
0306           mipg[igmt] = (*gmt_iter).mip();
0307           dwg[igmt] = (*gmt_iter).getDataWord();
0308 
0309           idxRPCb[igmt] = -1;
0310           idxRPCf[igmt] = -1;
0311           idxDTBX[igmt] = -1;
0312           idxCSC[igmt] = -1;
0313 
0314           if ((*gmt_iter).isMatchedCand() || (*gmt_iter).isRPC()) {
0315             if ((*gmt_iter).isFwd()) {
0316               idxRPCf[igmt] = (*gmt_iter).getRPCIndex();
0317             } else {
0318               idxRPCb[igmt] = (*gmt_iter).getRPCIndex();
0319             }
0320           }
0321 
0322           if ((*gmt_iter).isMatchedCand() || (!(*gmt_iter).isRPC())) {
0323             if ((*gmt_iter).isFwd()) {
0324               idxCSC[igmt] = (*gmt_iter).getDTCSCIndex();
0325             } else {
0326               idxDTBX[igmt] = (*gmt_iter).getDTCSCIndex();
0327             }
0328           }
0329           igmt++;
0330         }
0331       }
0332     }
0333     ndt = idt;
0334     ncsc = icsc;
0335     nrpcb = irpcb;
0336     nrpcf = irpcf;
0337     ngmt = igmt;
0338   }
0339 
0340   //////////////////////////////////////////////////////////////////////
0341   if (m_GTEvmInputTag.label() != "none") {
0342     edm::Handle<L1GlobalTriggerEvmReadoutRecord> gtevmrr_handle;
0343     e.getByLabel(m_GTEvmInputTag.label(), gtevmrr_handle);
0344     L1GlobalTriggerEvmReadoutRecord const* gtevmrr = gtevmrr_handle.product();
0345 
0346     L1TcsWord tcsw = gtevmrr->tcsWord();
0347 
0348     bx = tcsw.bxNr();
0349     //    lumi = tcsw.luminositySegmentNr();
0350     //    runn = tcsw.partRunNr();
0351     //    eventn = tcsw.partTrigNr();
0352     orbitn = tcsw.orbitNr();
0353   }
0354 
0355   //////////////////////////////////////////////////////////////////////
0356   if (m_GTInputTag.label() != "none") {
0357     edm::Handle<L1GlobalTriggerReadoutRecord> gtrr_handle;
0358     e.getByLabel(m_GTInputTag.label(), gtrr_handle);
0359     L1GlobalTriggerReadoutRecord const* gtrr = gtrr_handle.product();
0360 
0361     int iel = 0;
0362     int ijet = 0;
0363     for (int ibx = -1; ibx <= 1; ibx++) {
0364       const L1GtPsbWord psb = gtrr->gtPsbWord(0xbb0d, ibx);
0365       vector<int> psbel;
0366       psbel.push_back(psb.aData(4));
0367       psbel.push_back(psb.aData(5));
0368       psbel.push_back(psb.bData(4));
0369       psbel.push_back(psb.bData(5));
0370       std::vector<int>::const_iterator ipsbel;
0371       for (ipsbel = psbel.begin(); ipsbel != psbel.end(); ipsbel++) {
0372         float rank = (*ipsbel) & 0x3f;
0373         if (rank > 0) {
0374           bxel[iel] = ibx;
0375           rankel[iel] = rank;
0376           phiel[iel] = ((*ipsbel) >> 10) & 0x1f;
0377           etael[iel] = (((*ipsbel) >> 6) & 7) * (((*ipsbel >> 9) & 1) ? -1 : 1);
0378           iel++;
0379         }
0380       }
0381       vector<int> psbjet;
0382       psbjet.push_back(psb.aData(2));
0383       psbjet.push_back(psb.aData(3));
0384       psbjet.push_back(psb.bData(2));
0385       psbjet.push_back(psb.bData(3));
0386       std::vector<int>::const_iterator ipsbjet;
0387       for (ipsbjet = psbjet.begin(); ipsbjet != psbjet.end(); ipsbjet++) {
0388         float rank = (*ipsbjet) & 0x3f;
0389         if (rank > 0) {
0390           bxjet[ijet] = ibx;
0391           rankjet[ijet] = rank;
0392           phijet[ijet] = ((*ipsbjet) >> 10) & 0x1f;
0393           etajet[ijet] = (((*ipsbjet) >> 6) & 7) * (((*ipsbjet >> 9) & 1) ? -1 : 1);
0394           ijet++;
0395         }
0396       }
0397     }
0398     nele = iel;
0399     njet = ijet;
0400 
0401     L1GtFdlWord fdlWord = gtrr->gtFdlWord();
0402 
0403     /// get Global Trigger algo and technical triger bit statistics
0404     for (int iebx = 0; iebx <= 2; iebx++) {
0405       DecisionWord gtDecisionWord = gtrr->decisionWord(iebx - 1);
0406 
0407       int dbitNumber = 0;
0408       gttw1[iebx] = 0;
0409       gttw2[iebx] = 0;
0410       gttt[iebx] = 0;
0411       DecisionWord::const_iterator GTdbitItr;
0412       for (GTdbitItr = gtDecisionWord.begin(); GTdbitItr != gtDecisionWord.end(); GTdbitItr++) {
0413         if (*GTdbitItr) {
0414           if (dbitNumber < 64) {
0415             gttw1[iebx] |= (1LL << dbitNumber);
0416           } else {
0417             gttw2[iebx] |= (1LL << (dbitNumber - 64));
0418           }
0419         }
0420         dbitNumber++;
0421       }
0422 
0423       dbitNumber = 0;
0424       TechnicalTriggerWord gtTTWord = gtrr->technicalTriggerWord(iebx - 1);
0425       TechnicalTriggerWord::const_iterator GTtbitItr;
0426       for (GTtbitItr = gtTTWord.begin(); GTtbitItr != gtTTWord.end(); GTtbitItr++) {
0427         if (*GTtbitItr) {
0428           gttt[iebx] |= (1LL << dbitNumber);
0429         }
0430         dbitNumber++;
0431       }
0432     }
0433   }
0434 
0435   m_tree->Fill();
0436 }
0437 
0438 //--------------
0439 // Operations --
0440 //--------------
0441 void L1MuGMTTree::book() {
0442   // GENERAL block branches
0443   m_tree->Branch("Run", &runn, "Run/I");
0444   m_tree->Branch("Event", &eventn, "Event/I");
0445   m_tree->Branch("Lumi", &lumi, "Lumi/I");
0446   m_tree->Branch("Bx", &bx, "Bx/I");
0447   m_tree->Branch("Orbit", &orbitn, "Orbit/l");
0448   m_tree->Branch("Time", &timest, "Time/l");
0449 
0450   // Generator info
0451   if (m_GeneratorInputTag.label() != "none") {
0452     m_tree->Branch("Weight", &weight, "Weight/F");
0453     m_tree->Branch("Pthat", &pthat, "Pthat/F");
0454   }
0455 
0456   // GEANT block branches
0457   if (m_SimulationInputTag.label() != "none") {
0458     m_tree->Branch("Ngen", &ngen, "Ngen/I");
0459     m_tree->Branch("Pxgen", pxgen, "Pxgen[Ngen]/F");
0460     m_tree->Branch("Pygen", pygen, "Pygen[Ngen]/F");
0461     m_tree->Branch("Pzgen", pzgen, "Pzgen[Ngen]/F");
0462     m_tree->Branch("Ptgen", ptgen, "Ptgen[Ngen]/F");
0463     m_tree->Branch("Etagen", etagen, "Etagen[Ngen]/F");
0464     m_tree->Branch("Phigen", phigen, "Phigen[Ngen]/F");
0465     m_tree->Branch("Chagen", chagen, "Chagen[Ngen]/I");
0466     m_tree->Branch("Vxgen", vxgen, "Vxgen[Ngen]/F");
0467     m_tree->Branch("Vygen", vygen, "Vygen[Ngen]/F");
0468     m_tree->Branch("Vzgen", vzgen, "Vzgen[Ngen]/F");
0469     m_tree->Branch("Pargen", pargen, "Pargen[Ngen]/I");
0470   }
0471 
0472   // GMT data
0473   if (m_GMTInputTag.label() != "none") {
0474     m_tree->Branch("Bxgmt", &bxgmt, "Bxgmt/I");
0475 
0476     // DTBX Trigger block branches
0477     m_tree->Branch("Ndt", &ndt, "Ndt/I");
0478     m_tree->Branch("Bxd", bxd, "Bxd[Ndt]/I");
0479     m_tree->Branch("Ptd", ptd, "Ptd[Ndt]/F");
0480     m_tree->Branch("Chad", chad, "Chad[Ndt]/I");
0481     m_tree->Branch("Etad", etad, "Etad[Ndt]/F");
0482     m_tree->Branch("Etafined", etafined, "Etafined[Ndt]/I");
0483     m_tree->Branch("Phid", phid, "Phid[Ndt]/F");
0484     m_tree->Branch("Quald", quald, "Quald[Ndt]/I");
0485     m_tree->Branch("Dwd", dwd, "Dwd[Ndt]/I");
0486     m_tree->Branch("Chd", chd, "Chd[Ndt]/I");
0487 
0488     // CSC Trigger block branches
0489     m_tree->Branch("Ncsc", &ncsc, "Ncsc/I");
0490     m_tree->Branch("Bxc", bxc, "Bxc[Ncsc]/I");
0491     m_tree->Branch("Ptc", ptc, "Ptc[Ncsc]/F");
0492     m_tree->Branch("Chac", chac, "Chac[Ncsc]/I");
0493     m_tree->Branch("Etac", etac, "Etac[Ncsc]/F");
0494     m_tree->Branch("Phic", phic, "Phic[Ncsc]/F");
0495     m_tree->Branch("Qualc", qualc, "Qualc[Ncsc]/I");
0496     m_tree->Branch("Dwc", dwc, "Dwc[Ncsc]/I");
0497 
0498     // RPC barrel Trigger branches
0499     m_tree->Branch("Nrpcb", &nrpcb, "Nrpcb/I");
0500     m_tree->Branch("Bxrb", bxrb, "Bxrb[Nrpcb]/I");
0501     m_tree->Branch("Ptrb", ptrb, "Ptrb[Nrpcb]/F");
0502     m_tree->Branch("Charb", charb, "Charb[Nrpcb]/I");
0503     m_tree->Branch("Etarb", etarb, "Etarb[Nrpcb]/F");
0504     m_tree->Branch("Phirb", phirb, "Phirb[Nrpcb]/F");
0505     m_tree->Branch("Qualrb", qualrb, "Qualrb[Nrpcb]/I");
0506     m_tree->Branch("Dwrb", dwrb, "Dwrb[Nrpcb]/I");
0507 
0508     // RPC forward Trigger branches
0509     m_tree->Branch("Nrpcf", &nrpcf, "Nrpcf/I");
0510     m_tree->Branch("Bxrf", bxrf, "Bxrf[Nrpcf]/I");
0511     m_tree->Branch("Ptrf", ptrf, "Ptrf[Nrpcf]/F");
0512     m_tree->Branch("Charf", charf, "Charf[Nrpcf]/I");
0513     m_tree->Branch("Etarf", etarf, "Etarf[Nrpcf]/F");
0514     m_tree->Branch("Phirf", phirf, "Phirf[Nrpcf]/F");
0515     m_tree->Branch("Qualrf", qualrf, "Qualrf[Nrpcf]/I");
0516     m_tree->Branch("Dwrf", dwrf, "Dwrf[Nrpcf]/I");
0517 
0518     // Global Muon trigger branches
0519     m_tree->Branch("Ngmt", &ngmt, "Ngmt/I");
0520     m_tree->Branch("Bxg", bxg, "Bxg[Ngmt]/I");
0521     m_tree->Branch("Ptg", ptg, "Ptg[Ngmt]/F");
0522     m_tree->Branch("Chag", chag, "Chag[Ngmt]/I");
0523     m_tree->Branch("Etag", etag, "Etag[Ngmt]/F");
0524     m_tree->Branch("Phig", phig, "Phig[Ngmt]/F");
0525     m_tree->Branch("Qualg", qualg, "Qualg[Ngmt]/I");
0526     m_tree->Branch("Detg", detg, "Detg[Ngmt]/I");
0527     m_tree->Branch("Rankg", rankg, "Rankg[Ngmt]/I");
0528     m_tree->Branch("Isolg", isolg, "Isolg[Ngmt]/I");
0529     m_tree->Branch("Mipg", mipg, "Mipg[Ngmt]/I");
0530     m_tree->Branch("Dwg", dwg, "Dwg[Ngmt]/I");
0531     m_tree->Branch("IdxRPCb", idxRPCb, "IdxRPCb[Ngmt]/I");
0532     m_tree->Branch("IdxRPCf", idxRPCf, "IdxRPCf[Ngmt]/I");
0533     m_tree->Branch("IdxDTBX", idxDTBX, "IdxDTBX[Ngmt]/I");
0534     m_tree->Branch("IdxCSC", idxCSC, "IdxCSC[Ngmt]/I");
0535   }
0536 
0537   if (m_GTInputTag.label() != "none") {
0538     // PSB block branches
0539     m_tree->Branch("Gttw1", gttw1, "Gttw1[3]/l");
0540     m_tree->Branch("Gttw2", gttw2, "Gttw2[3]/l");
0541     m_tree->Branch("Gttt", gttt, "Gttt[3]/l");
0542 
0543     m_tree->Branch("Nele", &nele, "Nele/I");
0544     m_tree->Branch("Bxel", bxel, "Bxel[Nele]/I");
0545     m_tree->Branch("Rankel", rankel, "Rankel[Nele]/F");
0546     m_tree->Branch("Phiel", phiel, "Phiel[Nele]/F");
0547     m_tree->Branch("Etael", etael, "Etael[Nele]/F");
0548 
0549     m_tree->Branch("Njet", &njet, "Njet/I");
0550     m_tree->Branch("Bxjet", bxjet, "Bxjet[Njet]/I");
0551     m_tree->Branch("Rankjet", rankjet, "Rankjet[Njet]/F");
0552     m_tree->Branch("Phijet", phijet, "Phijet[Njet]/F");
0553     m_tree->Branch("Etajet", etajet, "Etajet[Njet]/F");
0554   }
0555 }
0556 
0557 //define this as a plug-in
0558 DEFINE_FWK_MODULE(L1MuGMTTree);