CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
GtToGctCands.cc
Go to the documentation of this file.
1 // -*- C++ -*-
2 //
3 // Package: GtToGctCands
4 // Class: GtToGctCands
5 //
11 //
12 // Original Author: Alex Tapper
13 // Created: Mon Mar 30 17:31:03 CEST 2009
14 // $Id: GtToGctCands.cc,v 1.5 2009/04/05 16:19:20 tapper Exp $
15 //
16 //
17 
20 
22  m_GTInputTag(iConfig.getParameter<edm::InputTag>("inputLabel"))
23 {
24  // For now I am making one collection from all 3 BXs.
25  // This is the easiest format to analyse for CRAFT data.
26  // In the future I should treat the mutiple BXs properly, and add energy sums.
27 
28  // list of products
29  produces<L1GctEmCandCollection>("isoEm");
30  produces<L1GctEmCandCollection>("nonIsoEm");
31  produces<L1GctJetCandCollection>("cenJets");
32  produces<L1GctJetCandCollection>("forJets");
33  produces<L1GctJetCandCollection>("tauJets");
34  produces<L1GctEtTotalCollection>();
35  produces<L1GctEtHadCollection>();
36  produces<L1GctEtMissCollection>();
37  // produces<L1GctHtMissCollection>();
38  produces<L1GctHFBitCountsCollection>();
39  produces<L1GctHFRingEtSumsCollection>();
40 }
41 
43 
45 {
46  // create the em and jet collections
47  std::auto_ptr<L1GctEmCandCollection> isoEm (new L1GctEmCandCollection);
48  std::auto_ptr<L1GctEmCandCollection> nonIsoEm (new L1GctEmCandCollection);
49  std::auto_ptr<L1GctJetCandCollection> cenJet (new L1GctJetCandCollection);
50  std::auto_ptr<L1GctJetCandCollection> forJet (new L1GctJetCandCollection);
51  std::auto_ptr<L1GctJetCandCollection> tauJet (new L1GctJetCandCollection);
52 
53  // create the energy sum digis
54  std::auto_ptr<L1GctEtTotalCollection> etTot (new L1GctEtTotalCollection);
55  std::auto_ptr<L1GctEtHadCollection> etHad (new L1GctEtHadCollection);
56  std::auto_ptr<L1GctEtMissCollection> etMiss (new L1GctEtMissCollection);
57 // std::auto_ptr<L1GctHtMissCollection> htMiss (new L1GctHtMissCollection));
58 
59  // create the Hf sums digis
60  std::auto_ptr<L1GctHFBitCountsCollection> hfBitCount (new L1GctHFBitCountsCollection);
61  std::auto_ptr<L1GctHFRingEtSumsCollection> hfRingEtSum (new L1GctHFRingEtSumsCollection);
62 
63  // Get GT data
65  iEvent.getByLabel(m_GTInputTag,gtrr_handle);
66  L1GlobalTriggerReadoutRecord const* gtrr = gtrr_handle.product();
67 
68  // Loop over 3BXs (shouldn't be hard coded really) and get GT cands
69  for (int ibx=-1; ibx<=1; ibx++) {
70  const L1GtPsbWord psb1 = gtrr->gtPsbWord(0xbb0d, ibx);
71  const L1GtPsbWord psb2 = gtrr->gtPsbWord(0xbb0e, ibx);
72 
73  // Isolated electrons
74  std::vector<int> psbisoel;
75  psbisoel.push_back(psb1.aData(6));
76  psbisoel.push_back(psb1.aData(7));
77  psbisoel.push_back(psb1.bData(6));
78  psbisoel.push_back(psb1.bData(7));
79  for(std::vector<int>::const_iterator ipsbisoel=psbisoel.begin(); ipsbisoel!=psbisoel.end(); ipsbisoel++) {
80  isoEm->push_back(L1GctEmCand((*ipsbisoel),true));
81  }
82 
83  // Non-isolated electrons
84  std::vector<int> psbel;
85  psbel.push_back(psb1.aData(4));
86  psbel.push_back(psb1.aData(5));
87  psbel.push_back(psb1.bData(4));
88  psbel.push_back(psb1.bData(5));
89  for(std::vector<int>::const_iterator ipsbel=psbel.begin(); ipsbel!=psbel.end(); ipsbel++) {
90  nonIsoEm->push_back(L1GctEmCand((*ipsbel),false));
91  }
92 
93  // Central jets
94  std::vector<int> psbjet;
95  psbjet.push_back(psb1.aData(2));
96  psbjet.push_back(psb1.aData(3));
97  psbjet.push_back(psb1.bData(2));
98  psbjet.push_back(psb1.bData(3));
99  for(std::vector<int>::const_iterator ipsbjet=psbjet.begin(); ipsbjet!=psbjet.end(); ipsbjet++) {
100  cenJet->push_back(L1GctJetCand((*ipsbjet),false,false));
101  }
102 
103  // Forward jets
104  std::vector<int> psbfjet;
105  psbfjet.push_back(psb1.aData(6));
106  psbfjet.push_back(psb1.aData(7));
107  psbfjet.push_back(psb1.bData(6));
108  psbfjet.push_back(psb1.bData(7));
109  for(std::vector<int>::const_iterator ipsbfjet=psbfjet.begin(); ipsbfjet!=psbfjet.end(); ipsbfjet++) {
110  forJet->push_back(L1GctJetCand((*ipsbfjet),false,true));
111  }
112 
113  // Tau jets
114  std::vector<int> psbtjet;
115  psbtjet.push_back(psb2.aData(6));
116  psbtjet.push_back(psb2.aData(7));
117  psbtjet.push_back(psb2.bData(6));
118  psbtjet.push_back(psb2.bData(7));
119  for(std::vector<int>::const_iterator ipsbtjet=psbtjet.begin(); ipsbtjet!=psbtjet.end(); ipsbtjet++) {
120  tauJet->push_back(L1GctJetCand((*ipsbtjet),true,false));
121  }
122 
123  }
124 
125  // put the collections into the event
126  iEvent.put(isoEm,"isoEm");
127  iEvent.put(nonIsoEm,"nonIsoEm");
128  iEvent.put(cenJet,"cenJets");
129  iEvent.put(forJet,"forJets");
130  iEvent.put(tauJet,"tauJets");
131  iEvent.put(etTot);
132  iEvent.put(etHad);
133  iEvent.put(etMiss);
134 // iEvent.put(htMiss);
135  iEvent.put(hfBitCount);
136  iEvent.put(hfRingEtSum);
137 }
edm::InputTag m_GTInputTag
Definition: GtToGctCands.h:44
virtual void produce(edm::Event &, const edm::EventSetup &)
Definition: GtToGctCands.cc:44
std::vector< L1GctEtMiss > L1GctEtMissCollection
std::vector< L1GctHFRingEtSums > L1GctHFRingEtSumsCollection
std::vector< L1GctEtHad > L1GctEtHadCollection
Level-1 Trigger jet candidate.
Definition: L1GctJetCand.h:18
Level-1 Trigger EM candidate at output of GCT.
Definition: L1GctEmCand.h:22
const L1GtPsbWord gtPsbWord(boost::uint16_t boardIdValue, int bxInEventValue) const
get / set PSB word (record) in the GT readout record
std::vector< L1GctEtTotal > L1GctEtTotalCollection
std::vector< L1GctHFBitCounts > L1GctHFBitCountsCollection
std::vector< L1GctJetCand > L1GctJetCandCollection
int iEvent
Definition: GenABIO.cc:243
GtToGctCands(const edm::ParameterSet &)
Definition: GtToGctCands.cc:21
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
Definition: Event.h:84
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:359
const boost::uint16_t aData(int iA) const
get/set A_DATA_CH_IA
Definition: L1GtPsbWord.cc:230
const boost::uint16_t bData(int iB) const
get/set B_DATA_CH_IB
Definition: L1GtPsbWord.cc:325
T const * product() const
Definition: Handle.h:74
std::vector< L1GctEmCand > L1GctEmCandCollection