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
l1t::L1TCaloUpgradeToGCTConverter Class Reference

#include <L1TCaloUpgradeToGCTConverter.h>

Inheritance diagram for l1t::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 JetToken_
 
EDGetToken TauToken_
 

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

Description: Emulator for the stage 1 jet algorithms.

Author
: Ivan Amos Cali MIT

Definition at line 53 of file L1TCaloUpgradeToGCTConverter.h.

Constructor & Destructor Documentation

l1t::L1TCaloUpgradeToGCTConverter::L1TCaloUpgradeToGCTConverter ( const ParameterSet iConfig)
explicit

Definition at line 22 of file L1TCaloUpgradeToGCTConverter.cc.

References EGammaToken_, EtSumToken_, edm::ParameterSet::getParameter(), JetToken_, and TauToken_.

23 {
24  produces<L1GctEmCandCollection>("isoEm");
25  produces<L1GctEmCandCollection>("nonIsoEm");
26  produces<L1GctJetCandCollection>("cenJets");
27  produces<L1GctJetCandCollection>("forJets");
28  produces<L1GctJetCandCollection>("tauJets");
29  produces<L1GctInternJetDataCollection>();
30  produces<L1GctEtTotalCollection>();
31  produces<L1GctEtHadCollection>();
32  produces<L1GctEtMissCollection>();
33  produces<L1GctHtMissCollection>();
34  produces<L1GctInternEtSumCollection>();
35  produces<L1GctInternHtMissCollection>();
36  produces<L1GctHFBitCountsCollection>();
37  produces<L1GctHFRingEtSumsCollection>();
38 
39  // register what you consume and keep token for later access:
40  EGammaToken_ = consumes<l1t::EGammaBxCollection>(iConfig.getParameter<InputTag>("InputCollection"));
41  TauToken_ = consumes<l1t::TauBxCollection>(iConfig.getParameter<InputTag>("InputCollection"));
42  JetToken_ = consumes<l1t::JetBxCollection>(iConfig.getParameter<InputTag>("InputCollection"));
43  EtSumToken_ = consumes<l1t::EtSumBxCollection>(iConfig.getParameter<InputTag>("InputCollection"));
44 }
T getParameter(std::string const &) const
l1t::L1TCaloUpgradeToGCTConverter::~L1TCaloUpgradeToGCTConverter ( )

Definition at line 47 of file L1TCaloUpgradeToGCTConverter.cc.

48 {
49 }

Member Function Documentation

void l1t::L1TCaloUpgradeToGCTConverter::beginJob ( void  )
privatevirtual

Reimplemented from edm::EDProducer.

Definition at line 261 of file L1TCaloUpgradeToGCTConverter.cc.

262 {
263 }
void l1t::L1TCaloUpgradeToGCTConverter::beginRun ( Run const &  iR,
EventSetup const &  iE 
)
privatevirtual

Reimplemented from edm::EDProducer.

Definition at line 273 of file L1TCaloUpgradeToGCTConverter.cc.

273  {
274 
275 }
void l1t::L1TCaloUpgradeToGCTConverter::endJob ( void  )
privatevirtual

Reimplemented from edm::EDProducer.

Definition at line 267 of file L1TCaloUpgradeToGCTConverter.cc.

267  {
268 }
void l1t::L1TCaloUpgradeToGCTConverter::endRun ( Run const &  iR,
EventSetup const &  iE 
)
privatevirtual

Reimplemented from edm::EDProducer.

Definition at line 279 of file L1TCaloUpgradeToGCTConverter.cc.

279  {
280 
281 }
void l1t::L1TCaloUpgradeToGCTConverter::fillDescriptions ( ConfigurationDescriptions descriptions)
static

Definition at line 286 of file L1TCaloUpgradeToGCTConverter.cc.

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

286  {
287  //The following says we do not know what parameters are allowed so do no validation
288  // Please change this to state exactly what you do use, even if it is no parameters
290  desc.setUnknown();
291  descriptions.addDefault(desc);
292 }
void addDefault(ParameterSetDescription const &psetDescription)
void l1t::L1TCaloUpgradeToGCTConverter::produce ( Event e,
EventSetup const &  es 
)
overrideprivatevirtual

Implements edm::EDProducer.

Definition at line 56 of file L1TCaloUpgradeToGCTConverter.cc.

References edm::EventSetup::get(), edm::Event::getByToken(), LogDebug, and edm::Event::put().

57 {
58  LogDebug("l1t|stage 1 Converter") << "L1TCaloUpgradeToGCTConverter::produce function called...\n";
59 
60  //inputs
62  e.getByToken(EGammaToken_,EGamma);
63 
65  e.getByToken(TauToken_,Tau);
66 
68  e.getByToken(JetToken_,Jet);
69 
71  e.getByToken(EtSumToken_,EtSum);
72 
74  es.get< L1EmEtScaleRcd >().get( emScale ) ;
75 
77  es.get< L1JetEtScaleRcd >().get( jetScale ) ;
78 
79 
80  // create the em and jet collections
81  std::auto_ptr<L1GctEmCandCollection> isoEmResult(new L1GctEmCandCollection( ) );
82  std::auto_ptr<L1GctEmCandCollection> nonIsoEmResult(new L1GctEmCandCollection( ) );
83  std::auto_ptr<L1GctJetCandCollection> cenJetResult(new L1GctJetCandCollection( ) );
84  std::auto_ptr<L1GctJetCandCollection> forJetResult(new L1GctJetCandCollection( ) );
85  std::auto_ptr<L1GctJetCandCollection> tauJetResult(new L1GctJetCandCollection( ) );
86 
87  // create the energy sum digis
88  std::auto_ptr<L1GctEtTotalCollection> etTotResult (new L1GctEtTotalCollection( ) );
89  std::auto_ptr<L1GctEtHadCollection> etHadResult (new L1GctEtHadCollection ( ) );
90  std::auto_ptr<L1GctEtMissCollection> etMissResult(new L1GctEtMissCollection ( ) );
91  std::auto_ptr<L1GctHtMissCollection> htMissResult(new L1GctHtMissCollection ( ) );
92 
93  // create the Hf sums digis
94  std::auto_ptr<L1GctHFBitCountsCollection> hfBitCountResult (new L1GctHFBitCountsCollection ( ) );
95  std::auto_ptr<L1GctHFRingEtSumsCollection> hfRingEtSumResult(new L1GctHFRingEtSumsCollection( ) );
96 
97  // create internal data collections
98  std::auto_ptr<L1GctInternJetDataCollection> internalJetResult (new L1GctInternJetDataCollection( ));
99  std::auto_ptr<L1GctInternEtSumCollection> internalEtSumResult (new L1GctInternEtSumCollection ( ));
100  std::auto_ptr<L1GctInternHtMissCollection> internalHtMissResult(new L1GctInternHtMissCollection ( ));
101 
102 
103  // Assume BX is the same for all collections
104  int firstBX = EGamma->getFirstBX();
105  int lastBX = EGamma->getLastBX();
106  // //Finding the BX range for each input collection
107  // int firstBxEGamma = EGamma->getFirstBX();
108  // int lastBxEGamma = EGamma->getLastBX();
109  // int firstBxTau = Tau->getFirstBX();
110  // int lastBxTau = Tau->getLastBX();
111  // int firstBxJet = Jet->getFirstBX();
112  // int lastBxJet = Jet->getLastBX();
113  // int firstBxEtSum = EtSum->getFirstBX();
114  // int lastBxEtSum = EtSum->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(l1t::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 
146  //looping over Tau elments with a specific BX
147  int tauCount = 0; //max 4
148  for(l1t::TauBxCollection::const_iterator itTau = Tau->begin(itBX);
149  itTau != Tau->end(itBX); ++itTau){
150  // forward def is okay for Taus
151  const bool forward= (itTau->hwEta() < 4 || itTau->hwEta() > 17);
152  const uint16_t rankPt = jetScale->rank((uint16_t)itTau->hwPt());
153 
154  unsigned iEta = itTau->hwEta();
155  unsigned rctEta = (iEta<11 ? 10-iEta : iEta-11);
156  unsigned gtEta=(((rctEta % 7) & 0x7) | (iEta<11 ? 0x8 : 0));
157 
158  L1GctJetCand TauCand(rankPt, itTau->hwPhi(), gtEta,
159  true, forward,0, 0, itBX);
160  //L1GctJetCand(unsigned rank, unsigned phi, unsigned eta,
161  // bool isTau, bool isFor, uint16_t block, uint16_t index, int16_t bx);
162  if(tauCount != 4){
163  tauJetResult->push_back(TauCand);
164  tauCount++;
165  }
166  }
167 
168  //looping over Jet elments with a specific BX
169  int forCount = 0; //max 4
170  int cenCount = 0; //max 4
171  for(l1t::JetBxCollection::const_iterator itJet = Jet->begin(itBX);
172  itJet != Jet->end(itBX); ++itJet){
173  // use 2nd quality bit to define forward
174  const bool forward = ((itJet->hwQual() & 0x2) != 0);
175  const uint16_t rankPt = jetScale->rank((uint16_t)itJet->hwPt());
176 
177  unsigned iEta = itJet->hwEta();
178  unsigned rctEta = (iEta<11 ? 10-iEta : iEta-11);
179  unsigned gtEta=(((rctEta % 7) & 0x7) | (iEta<11 ? 0x8 : 0));
180 
181  L1GctJetCand JetCand(rankPt, itJet->hwPhi(), gtEta,
182  false, forward,0, 0, itBX);
183  //L1GctJetCand(unsigned rank, unsigned phi, unsigned eta,
184  // bool isTau, bool isFor, uint16_t block, uint16_t index, int16_t bx);
185  if(forward) {
186  if(forCount !=4 ){
187  forJetResult->push_back(JetCand);
188  forCount++;
189  }
190  }
191  else {
192  if(cenCount != 4){
193  cenJetResult->push_back(JetCand);
194  cenCount++;
195  }
196  }
197  }
198  //looping over EtSum elments with a specific BX
199  for (l1t::EtSumBxCollection::const_iterator itEtSum = EtSum->begin(itBX);
200  itEtSum != EtSum->end(itBX); ++itEtSum){
201 
202  if (EtSum::EtSumType::kMissingEt == itEtSum->getType()){
203  L1GctEtMiss Cand(itEtSum->hwPt(), itEtSum->hwPhi(), 0, itBX);
204  etMissResult->push_back(Cand);
205  }else if (EtSum::EtSumType::kMissingHt == itEtSum->getType()){
206  L1GctHtMiss Cand(itEtSum->hwPt(), itEtSum->hwPhi(), 0, itBX);
207  htMissResult->push_back(Cand);
208  }else if (EtSum::EtSumType::kTotalEt == itEtSum->getType()){
209  L1GctEtTotal Cand(itEtSum->hwPt(), 0, itBX);
210  etTotResult->push_back(Cand);
211  }else if (EtSum::EtSumType::kTotalHt == itEtSum->getType()){
212  L1GctEtHad Cand(itEtSum->hwPt(), 0, itBX);
213  etHadResult->push_back(Cand);
214  }else {
215  LogError("l1t|stage 1 Converter") <<" Unknown EtSumType --- EtSum collection will not be saved...\n ";
216  }
217  }
218  }
219 
220 
221 
222  //*isoEmResult =
223  //this->ConvertToNonIsoEmCand(EGamma);
224  // DataFormatter.ConvertToNonIsoEmCand(*EGamma, nonIsoEmResult);
225  // DataFormatter.ConvertToCenJetCand(*Jet, cenJetResult);
226  // DataFormatter.ConvertToForJetCand(*Jet, forJetResult);
227  // DataFormatter.ConvertToTauJetCand(*Tau, tauJetResult);
228 
229  // DataFormatter.ConvertToEtTotal(EtSum, etTotResult);
230  // DataFormatter.ConvertToEtHad(EtSum,etHadResult);
231  // DataFormatter.ConvertToEtMiss(EtSum,etMissResult);
232  // DataFormatter.ConvertToHtMiss(EtSum,htMissResult);
233  // DataFormatter.ConvertToHFBitCounts(EtSum,hfBitCountResult);
234  // DataFormatter.ConvertToHFRingEtSums(EtSum, hfRingEtSumResult);
235 
236  // DataFormatter.ConvertToIntJet(Jet, internalJetResult);
237  // DataFormatter.ConvertToIntEtSum(EtSum,internalEtSumResult);
238  // DataFormatter.ConvertToIntHtMiss(EtSum,internalHtMissResult);
239 
240 
241 
242  e.put(isoEmResult,"isoEm");
243  e.put(nonIsoEmResult,"nonIsoEm");
244  e.put(cenJetResult,"cenJets");
245  e.put(forJetResult,"forJets");
246  e.put(tauJetResult,"tauJets");
247  e.put(etTotResult);
248  e.put(etHadResult);
249  e.put(etMissResult);
250  e.put(htMissResult);
251  e.put(hfBitCountResult);
252  e.put(hfRingEtSumResult);
253 
254  e.put(internalJetResult);
255  e.put(internalEtSumResult);
256  e.put(internalHtMissResult);
257 }
#define LogDebug(id)
std::vector< L1GctEtMiss > L1GctEtMissCollection
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:434
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:116
Persistable copy of total Et measured at Level-1.
Definition: L1GctEtTotal.h:18
Persistable copy of total Ht measured at Level-1.
Definition: L1GctEtHad.h:18
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 l1t::L1TCaloUpgradeToGCTConverter::EGammaToken_
private

Definition at line 86 of file L1TCaloUpgradeToGCTConverter.h.

Referenced by L1TCaloUpgradeToGCTConverter().

EDGetToken l1t::L1TCaloUpgradeToGCTConverter::EtSumToken_
private

Definition at line 89 of file L1TCaloUpgradeToGCTConverter.h.

Referenced by L1TCaloUpgradeToGCTConverter().

EDGetToken l1t::L1TCaloUpgradeToGCTConverter::JetToken_
private

Definition at line 88 of file L1TCaloUpgradeToGCTConverter.h.

Referenced by L1TCaloUpgradeToGCTConverter().

EDGetToken l1t::L1TCaloUpgradeToGCTConverter::TauToken_
private

Definition at line 87 of file L1TCaloUpgradeToGCTConverter.h.

Referenced by L1TCaloUpgradeToGCTConverter().