CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes
L1TCaloUpgradeToGCTConverter Class Reference

#include <L1TCaloUpgradeToGCTConverter.h>

Inheritance diagram for L1TCaloUpgradeToGCTConverter:
edm::EDProducer edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Member Functions

 L1TCaloUpgradeToGCTConverter (const ParameterSet &)
 
 ~L1TCaloUpgradeToGCTConverter ()
 
- Public Member Functions inherited from edm::EDProducer
 EDProducer ()
 
ModuleDescription const & moduleDescription () const
 
virtual ~EDProducer ()
 
- Public Member Functions inherited from edm::ProducerBase
 ProducerBase ()
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
std::function< void(BranchDescription
const &)> 
registrationCallback () const
 used by the fwk to register list of products More...
 
virtual ~ProducerBase ()
 
- Public Member Functions inherited from edm::EDConsumerBase
 EDConsumerBase ()
 
ProductHolderIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
std::vector
< ProductHolderIndexAndSkipBit >
const & 
itemsToGetFromEvent () const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesDependentUpon (const std::string &iProcessName, std::vector< const char * > &oModuleLabels) const
 
bool registeredToConsume (ProductHolderIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductHolderIndexHelper const &)
 
virtual ~EDConsumerBase ()
 

Static Public Member Functions

static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
- Static Public Member Functions inherited from edm::EDProducer
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 

Private Member Functions

virtual void beginJob ()
 
virtual void beginRun (Run const &iR, EventSetup const &iE)
 
virtual void endJob ()
 
virtual void endRun (Run const &iR, EventSetup const &iE)
 
virtual void produce (Event &, EventSetup const &) override
 

Private Attributes

EDGetToken EGammaToken_
 
EDGetToken EtSumToken_
 
EDGetToken HfCountsToken_
 
EDGetToken HfSumsToken_
 
EDGetToken IsoTauToken_
 
EDGetToken JetToken_
 
EDGetToken RlxTauToken_
 

Additional Inherited Members

- Public Types inherited from edm::EDProducer
typedef EDProducer ModuleType
 
- Public Types inherited from edm::ProducerBase
typedef
ProductRegistryHelper::TypeLabelList 
TypeLabelList
 
- Protected Member Functions inherited from edm::ProducerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
- Protected Member Functions inherited from edm::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken consumes (TypeToGet const &id, edm::InputTag const &tag)
 
ConsumesCollector consumesCollector ()
 Use a ConsumesCollector to gather consumes information from helper functions. More...
 
template<typename ProductType , BranchType B = InEvent>
void consumesMany ()
 
void consumesMany (const TypeToGet &id)
 
template<BranchType B>
void consumesMany (const TypeToGet &id)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 

Detailed Description

Definition at line 53 of file L1TCaloUpgradeToGCTConverter.h.

Constructor & Destructor Documentation

L1TCaloUpgradeToGCTConverter::L1TCaloUpgradeToGCTConverter ( const ParameterSet iConfig)
explicit

Definition at line 24 of file L1TCaloUpgradeToGCTConverter.cc.

References edm::ParameterSet::getParameter().

25 {
26  produces<L1GctEmCandCollection>("isoEm");
27  produces<L1GctEmCandCollection>("nonIsoEm");
28  produces<L1GctJetCandCollection>("cenJets");
29  produces<L1GctJetCandCollection>("forJets");
30  produces<L1GctJetCandCollection>("tauJets");
31  produces<L1GctJetCandCollection>("isoTauJets");
32  produces<L1GctInternJetDataCollection>();
33  produces<L1GctEtTotalCollection>();
34  produces<L1GctEtHadCollection>();
35  produces<L1GctEtMissCollection>();
36  produces<L1GctHtMissCollection>();
37  produces<L1GctInternEtSumCollection>();
38  produces<L1GctInternHtMissCollection>();
39  produces<L1GctHFBitCountsCollection>();
40  produces<L1GctHFRingEtSumsCollection>();
41 
42  // register what you consume and keep token for later access:
43  EGammaToken_ = consumes<EGammaBxCollection>(iConfig.getParameter<InputTag>("InputCollection"));
44  RlxTauToken_ = consumes<TauBxCollection>(iConfig.getParameter<InputTag>("InputRlxTauCollection"));
45  IsoTauToken_ = consumes<TauBxCollection>(iConfig.getParameter<InputTag>("InputIsoTauCollection"));
46  JetToken_ = consumes<JetBxCollection>(iConfig.getParameter<InputTag>("InputCollection"));
47  EtSumToken_ = consumes<EtSumBxCollection>(iConfig.getParameter<InputTag>("InputCollection"));
48  HfSumsToken_ = consumes<CaloSpareBxCollection>(iConfig.getParameter<edm::InputTag>("InputHFSumsCollection"));
49  HfCountsToken_ = consumes<CaloSpareBxCollection>(iConfig.getParameter<edm::InputTag>("InputHFCountsCollection"));
50 }
T getParameter(std::string const &) const
L1TCaloUpgradeToGCTConverter::~L1TCaloUpgradeToGCTConverter ( )

Definition at line 53 of file L1TCaloUpgradeToGCTConverter.cc.

54 {
55 }

Member Function Documentation

void L1TCaloUpgradeToGCTConverter::beginJob ( void  )
privatevirtual

Reimplemented from edm::EDProducer.

Definition at line 290 of file L1TCaloUpgradeToGCTConverter.cc.

291 {
292 }
void L1TCaloUpgradeToGCTConverter::beginRun ( Run const &  iR,
EventSetup const &  iE 
)
privatevirtual

Reimplemented from edm::EDProducer.

Definition at line 302 of file L1TCaloUpgradeToGCTConverter.cc.

302  {
303 
304 }
void L1TCaloUpgradeToGCTConverter::endJob ( void  )
privatevirtual

Reimplemented from edm::EDProducer.

Definition at line 296 of file L1TCaloUpgradeToGCTConverter.cc.

296  {
297 }
void L1TCaloUpgradeToGCTConverter::endRun ( Run const &  iR,
EventSetup const &  iE 
)
privatevirtual

Reimplemented from edm::EDProducer.

Definition at line 308 of file L1TCaloUpgradeToGCTConverter.cc.

308  {
309 
310 }
void L1TCaloUpgradeToGCTConverter::fillDescriptions ( ConfigurationDescriptions descriptions)
static

Definition at line 315 of file L1TCaloUpgradeToGCTConverter.cc.

References edm::ConfigurationDescriptions::addDefault(), and edm::ParameterSetDescription::setUnknown().

315  {
316  //The following says we do not know what parameters are allowed so do no validation
317  // Please change this to state exactly what you do use, even if it is no parameters
319  desc.setUnknown();
320  descriptions.addDefault(desc);
321 }
void addDefault(ParameterSetDescription const &psetDescription)
void L1TCaloUpgradeToGCTConverter::produce ( Event e,
EventSetup const &  es 
)
overrideprivatevirtual

Implements edm::EDProducer.

Definition at line 62 of file L1TCaloUpgradeToGCTConverter.cc.

References L1GctHFRingEtSums::fromGctEmulator(), edm::Event::getByToken(), i, configurableAnalysis::Jet, LogDebug, edm::Event::put(), and L1GctHFRingEtSums::setEtSum().

63 {
64  LogDebug("l1t|stage 1 Converter") << "L1TCaloUpgradeToGCTConverter::produce function called...\n";
65 
66  //inputs
68  e.getByToken(EGammaToken_,EGamma);
69 
71  e.getByToken(RlxTauToken_,RlxTau);
72 
74  e.getByToken(IsoTauToken_,IsoTau);
75 
77  e.getByToken(JetToken_,Jet);
78 
80  e.getByToken(EtSumToken_,EtSum);
81 
83  e.getByToken(HfSumsToken_, HfSums);
84 
86  e.getByToken(HfCountsToken_, HfCounts);
87 
88  // create the em and jet collections
89  std::auto_ptr<L1GctEmCandCollection> isoEmResult(new L1GctEmCandCollection( ) );
90  std::auto_ptr<L1GctEmCandCollection> nonIsoEmResult(new L1GctEmCandCollection( ) );
91  std::auto_ptr<L1GctJetCandCollection> cenJetResult(new L1GctJetCandCollection( ) );
92  std::auto_ptr<L1GctJetCandCollection> forJetResult(new L1GctJetCandCollection( ) );
93  std::auto_ptr<L1GctJetCandCollection> tauJetResult(new L1GctJetCandCollection( ) );
94  std::auto_ptr<L1GctJetCandCollection> isoTauJetResult(new L1GctJetCandCollection( ) );
95 
96  // create the energy sum digis
97  std::auto_ptr<L1GctEtTotalCollection> etTotResult (new L1GctEtTotalCollection( ) );
98  std::auto_ptr<L1GctEtHadCollection> etHadResult (new L1GctEtHadCollection ( ) );
99  std::auto_ptr<L1GctEtMissCollection> etMissResult(new L1GctEtMissCollection ( ) );
100  std::auto_ptr<L1GctHtMissCollection> htMissResult(new L1GctHtMissCollection ( ) );
101 
102  // create the Hf sums digis
103  std::auto_ptr<L1GctHFBitCountsCollection> hfBitCountResult (new L1GctHFBitCountsCollection ( ) );
104  std::auto_ptr<L1GctHFRingEtSumsCollection> hfRingEtSumResult(new L1GctHFRingEtSumsCollection( ) );
105 
106  // create internal data collections
107  std::auto_ptr<L1GctInternJetDataCollection> internalJetResult (new L1GctInternJetDataCollection( ));
108  std::auto_ptr<L1GctInternEtSumCollection> internalEtSumResult (new L1GctInternEtSumCollection ( ));
109  std::auto_ptr<L1GctInternHtMissCollection> internalHtMissResult(new L1GctInternHtMissCollection ( ));
110 
111 
112  // Assume BX is the same for all collections
113  int firstBX = EGamma->getFirstBX();
114  int lastBX = EGamma->getLastBX();
115 
116  for(int itBX=firstBX; itBX!=lastBX+1; ++itBX){
117 
118  //looping over EGamma elments with a specific BX
119  int nonIsoCount = 0;
120  int isoCount = 0;
121  for(EGammaBxCollection::const_iterator itEGamma = EGamma->begin(itBX);
122  itEGamma != EGamma->end(itBX); ++itEGamma){
123  bool iso = itEGamma->hwIso();
124 
125  L1GctEmCand EmCand(itEGamma->hwPt(), itEGamma->hwPhi(), itEGamma->hwEta(),
126  iso, 0, 0, itBX);
127  //L1GctEmCand(unsigned rank, unsigned phi, unsigned eta,
128  // bool iso, uint16_t block, uint16_t index, int16_t bx);
129 
130  if(iso){
131  if(isoCount != 4)
132  {
133  isoEmResult->push_back(EmCand);
134  isoCount++;
135  }
136  }
137  else{
138  if(nonIsoCount != 4)
139  {
140  nonIsoEmResult->push_back(EmCand);
141  nonIsoCount++;
142  }
143  }
144  }
145  isoEmResult->resize(4);
146  nonIsoEmResult->resize(4);
147 
148  //looping over Tau elments with a specific BX
149  int tauCount = 0; //max 4
150  for(TauBxCollection::const_iterator itTau = RlxTau->begin(itBX);
151  itTau != RlxTau->end(itBX); ++itTau){
152  // taus are not allowed to be forward
153  const bool forward= false;
154 
155  L1GctJetCand TauCand(itTau->hwPt(), itTau->hwPhi(), itTau->hwEta(),
156  true, forward,0, 0, itBX);
157  //L1GctJetCand(unsigned rank, unsigned phi, unsigned eta,
158  // bool isTau, bool isFor, uint16_t block, uint16_t index, int16_t bx);
159  if(tauCount != 4){
160  tauJetResult->push_back(TauCand);
161  tauCount++;
162  }
163  }
164  tauJetResult->resize(4);
165 
166 
167  //looping over Iso Tau elments with a specific BX
168  int isoTauCount = 0; //max 4
169  for(TauBxCollection::const_iterator itTau = IsoTau->begin(itBX);
170  itTau != IsoTau->end(itBX); ++itTau){
171  // taus are not allowed to be forward
172  const bool forward= false;
173 
174  L1GctJetCand TauCand(itTau->hwPt(), itTau->hwPhi(), itTau->hwEta(),
175  true, forward,0, 0, itBX);
176  //L1GctJetCand(unsigned rank, unsigned phi, unsigned eta,
177  // bool isTau, bool isFor, uint16_t block, uint16_t index, int16_t bx);
178  if(isoTauCount != 4){
179  isoTauJetResult->push_back(TauCand);
180  isoTauCount++;
181  }
182  }
183  isoTauJetResult->resize(4);
184 
185 
186  //looping over Jet elments with a specific BX
187  int forCount = 0; //max 4
188  int cenCount = 0; //max 4
189  for(JetBxCollection::const_iterator itJet = Jet->begin(itBX);
190  itJet != Jet->end(itBX); ++itJet){
191  // use 2nd quality bit to define forward
192  const bool forward = ((itJet->hwQual() & 0x2) != 0);
193  L1GctJetCand JetCand(itJet->hwPt(), itJet->hwPhi(), itJet->hwEta(),
194  false, forward,0, 0, itBX);
195  //L1GctJetCand(unsigned rank, unsigned phi, unsigned eta,
196  // bool isTau, bool isFor, uint16_t block, uint16_t index, int16_t bx);
197  if(forward) {
198  if(forCount !=4 ){
199  forJetResult->push_back(JetCand);
200  forCount++;
201  }
202  }
203  else {
204  if(cenCount != 4){
205  cenJetResult->push_back(JetCand);
206  cenCount++;
207  }
208  }
209  }
210  forJetResult->resize(4);
211  cenJetResult->resize(4);
212 
213  //looping over EtSum elments with a specific BX
214  for (EtSumBxCollection::const_iterator itEtSum = EtSum->begin(itBX);
215  itEtSum != EtSum->end(itBX); ++itEtSum){
216 
217  if (EtSum::EtSumType::kMissingEt == itEtSum->getType()){
218  L1GctEtMiss Cand(itEtSum->hwPt(), itEtSum->hwPhi(), itEtSum->hwQual()&0x1, itBX);
219  etMissResult->push_back(Cand);
220  }else if (EtSum::EtSumType::kMissingHt == itEtSum->getType()){
221  L1GctHtMiss Cand(itEtSum->hwPt(), itEtSum->hwPhi(), itEtSum->hwQual()&0x1, itBX);
222  htMissResult->push_back(Cand);
223  }else if (EtSum::EtSumType::kTotalEt == itEtSum->getType()){
224  L1GctEtTotal Cand(itEtSum->hwPt(), itEtSum->hwQual()&0x1, itBX);
225  etTotResult->push_back(Cand);
226  }else if (EtSum::EtSumType::kTotalHt == itEtSum->getType()){
227  L1GctEtHad Cand(itEtSum->hwPt(), itEtSum->hwQual()&0x1, itBX);
228  etHadResult->push_back(Cand);
229  }else {
230  LogError("l1t|stage 1 Converter") <<" Unknown EtSumType --- EtSum collection will not be saved...\n ";
231  }
232  }
233  etMissResult->resize(1);
234  htMissResult->resize(1);
235  etTotResult->resize(1);
236  etHadResult->resize(1);
237 
239  0,
240  0,
241  0,
242  0);
243  for (CaloSpareBxCollection::const_iterator itCaloSpare = HfSums->begin(itBX);
244  itCaloSpare != HfSums->end(itBX); ++itCaloSpare){
245  // if (CaloSpare::CaloSpareType::V2 == itCaloSpare->getType())
246  // {
247  // sum.setEtSum(3, itCaloSpare->hwPt());
248  // } else if (CaloSpare::CaloSpareType::Centrality == itCaloSpare->getType())
249  // {
250  // sum.setEtSum(0, itCaloSpare->hwPt());
251  // } else if (CaloSpare::CaloSpareType::Tau == itCaloSpare->getType())
252  // {
253  // sum.setEtSum(0, itCaloSpare->hwPt() & 0x7);
254  // sum.setEtSum(1, (itCaloSpare->hwPt() >> 3) & 0x7);
255  // sum.setEtSum(2, (itCaloSpare->hwPt() >> 6) & 0x7);
256  // sum.setEtSum(3, (itCaloSpare->hwPt() >> 9) & 0x7);
257  // }
258  for(int i = 0; i < 4; i++)
259  {
260  sum.setEtSum(i, itCaloSpare->GetRing(i));
261  }
262  }
263  hfRingEtSumResult->push_back(sum);
264 
265  hfRingEtSumResult->resize(1);
266  //no hfBitCounts yet
267  hfBitCountResult->resize(1);
268  }
269 
270  e.put(isoEmResult,"isoEm");
271  e.put(nonIsoEmResult,"nonIsoEm");
272  e.put(cenJetResult,"cenJets");
273  e.put(forJetResult,"forJets");
274  e.put(tauJetResult,"tauJets");
275  e.put(isoTauJetResult,"isoTauJets");
276  e.put(etTotResult);
277  e.put(etHadResult);
278  e.put(etMissResult);
279  e.put(htMissResult);
280  e.put(hfBitCountResult);
281  e.put(hfRingEtSumResult);
282 
283  e.put(internalJetResult);
284  e.put(internalEtSumResult);
285  e.put(internalHtMissResult);
286 }
static L1GctHFRingEtSums fromGctEmulator(const int16_t bx, const uint16_t etSumPosEtaRing1, const uint16_t etSumNegEtaRing1, const uint16_t etSumPosEtaRing2, const uint16_t etSumNegEtaRing2)
named ctor for GCT emulator
#define LogDebug(id)
int i
Definition: DBlmapReader.cc:9
std::vector< L1GctEtMiss > L1GctEtMissCollection
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:446
std::vector< L1GctHFRingEtSums > L1GctHFRingEtSumsCollection
std::vector< L1GctEtHad > L1GctEtHadCollection
Level-1 Trigger jet candidate.
Definition: L1GctJetCand.h:18
std::vector< L1GctInternHtMiss > L1GctInternHtMissCollection
Persistable copy of missing Et measured at Level-1.
Definition: L1GctEtMiss.h:18
Level-1 Trigger EM candidate at output of GCT.
Definition: L1GctEmCand.h:22
std::vector< L1GctEtTotal > L1GctEtTotalCollection
std::vector< L1GctHFBitCounts > L1GctHFBitCountsCollection
std::vector< L1GctJetCand > L1GctJetCandCollection
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
Definition: Event.h:113
Persistable copy of total Et measured at Level-1.
Definition: L1GctEtTotal.h:18
void setEtSum(unsigned i, uint16_t et)
set a sum
Persistable copy of total Ht measured at Level-1.
Definition: L1GctEtHad.h:18
L1 GCT HF ring Et sums.
std::vector< L1GctHtMiss > L1GctHtMissCollection
Persistable copy of missing Et measured at Level-1.
Definition: L1GctHtMiss.h:16
std::vector< L1GctInternJetData > L1GctInternJetDataCollection
std::vector< L1GctInternEtSum > L1GctInternEtSumCollection
std::vector< EGamma >::const_iterator const_iterator
Definition: BXVector.h:16
std::vector< L1GctEmCand > L1GctEmCandCollection

Member Data Documentation

EDGetToken L1TCaloUpgradeToGCTConverter::EGammaToken_
private

Definition at line 67 of file L1TCaloUpgradeToGCTConverter.h.

EDGetToken L1TCaloUpgradeToGCTConverter::EtSumToken_
private

Definition at line 71 of file L1TCaloUpgradeToGCTConverter.h.

EDGetToken L1TCaloUpgradeToGCTConverter::HfCountsToken_
private

Definition at line 73 of file L1TCaloUpgradeToGCTConverter.h.

EDGetToken L1TCaloUpgradeToGCTConverter::HfSumsToken_
private

Definition at line 72 of file L1TCaloUpgradeToGCTConverter.h.

EDGetToken L1TCaloUpgradeToGCTConverter::IsoTauToken_
private

Definition at line 69 of file L1TCaloUpgradeToGCTConverter.h.

EDGetToken L1TCaloUpgradeToGCTConverter::JetToken_
private

Definition at line 70 of file L1TCaloUpgradeToGCTConverter.h.

EDGetToken L1TCaloUpgradeToGCTConverter::RlxTauToken_
private

Definition at line 68 of file L1TCaloUpgradeToGCTConverter.h.