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
std::vector< ConsumesInfoconsumesInfo () const
 
 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
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) 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 306 of file L1TCaloUpgradeToGCTConverter.cc.

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

Reimplemented from edm::EDProducer.

Definition at line 318 of file L1TCaloUpgradeToGCTConverter.cc.

318  {
319 
320 }
void L1TCaloUpgradeToGCTConverter::endJob ( void  )
privatevirtual

Reimplemented from edm::EDProducer.

Definition at line 312 of file L1TCaloUpgradeToGCTConverter.cc.

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

Reimplemented from edm::EDProducer.

Definition at line 324 of file L1TCaloUpgradeToGCTConverter.cc.

324  {
325 
326 }
void L1TCaloUpgradeToGCTConverter::fillDescriptions ( ConfigurationDescriptions descriptions)
static

Definition at line 331 of file L1TCaloUpgradeToGCTConverter.cc.

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

331  {
332  //The following says we do not know what parameters are allowed so do no validation
333  // Please change this to state exactly what you do use, even if it is no parameters
335  desc.setUnknown();
336  descriptions.addDefault(desc);
337 }
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  int bxCounter = 0;
112 
113  for(int itBX=EGamma->getFirstBX(); itBX<=EGamma->getLastBX(); ++itBX){
114  bxCounter++;
115 
116  //looping over EGamma elments with a specific BX
117  int nonIsoCount = 0;
118  int isoCount = 0;
119  for(EGammaBxCollection::const_iterator itEGamma = EGamma->begin(itBX);
120  itEGamma != EGamma->end(itBX); ++itEGamma){
121  bool iso = itEGamma->hwIso();
122 
123  L1GctEmCand EmCand(itEGamma->hwPt(), itEGamma->hwPhi(), itEGamma->hwEta(),
124  iso, 0, 0, itBX);
125  //L1GctEmCand(unsigned rank, unsigned phi, unsigned eta,
126  // bool iso, uint16_t block, uint16_t index, int16_t bx);
127 
128  if(iso){
129  if(isoCount != 4)
130  {
131  isoEmResult->push_back(EmCand);
132  isoCount++;
133  }
134  }
135  else{
136  if(nonIsoCount != 4)
137  {
138  nonIsoEmResult->push_back(EmCand);
139  nonIsoCount++;
140  }
141  }
142  }
143  isoEmResult->resize(4*bxCounter);
144  nonIsoEmResult->resize(4*bxCounter);
145  }
146 
147  bxCounter = 0;
148  for(int itBX=RlxTau->getFirstBX(); itBX<=RlxTau->getLastBX(); ++itBX){
149  bxCounter++;
150  //looping over Tau elments with a specific BX
151  int tauCount = 0; //max 4
152  for(TauBxCollection::const_iterator itTau = RlxTau->begin(itBX);
153  itTau != RlxTau->end(itBX); ++itTau){
154  // taus are not allowed to be forward
155  const bool forward= false;
156 
157  L1GctJetCand TauCand(itTau->hwPt(), itTau->hwPhi(), itTau->hwEta(),
158  true, forward,0, 0, itBX);
159  //L1GctJetCand(unsigned rank, unsigned phi, unsigned eta,
160  // bool isTau, bool isFor, uint16_t block, uint16_t index, int16_t bx);
161  if(tauCount != 4){
162  tauJetResult->push_back(TauCand);
163  tauCount++;
164  }
165  }
166  tauJetResult->resize(4*bxCounter);
167  }
168 
169  bxCounter = 0;
170  for(int itBX=IsoTau->getFirstBX(); itBX<=IsoTau->getLastBX(); ++itBX){
171  bxCounter++;
172  //looping over Iso Tau elments with a specific BX
173  int isoTauCount = 0; //max 4
174  for(TauBxCollection::const_iterator itTau = IsoTau->begin(itBX);
175  itTau != IsoTau->end(itBX); ++itTau){
176  // taus are not allowed to be forward
177  const bool forward= false;
178 
179  L1GctJetCand TauCand(itTau->hwPt(), itTau->hwPhi(), itTau->hwEta(),
180  true, forward,0, 0, itBX);
181  //L1GctJetCand(unsigned rank, unsigned phi, unsigned eta,
182  // bool isTau, bool isFor, uint16_t block, uint16_t index, int16_t bx);
183  if(isoTauCount != 4){
184  isoTauJetResult->push_back(TauCand);
185  isoTauCount++;
186  }
187  }
188  isoTauJetResult->resize(4*bxCounter);
189  }
190 
191  bxCounter = 0;
192  for(int itBX=Jet->getFirstBX(); itBX<=Jet->getLastBX(); ++itBX){
193  bxCounter++;
194  //looping over Jet elments with a specific BX
195  int forCount = 0; //max 4
196  int cenCount = 0; //max 4
197  for(JetBxCollection::const_iterator itJet = Jet->begin(itBX);
198  itJet != Jet->end(itBX); ++itJet){
199  // use 2nd quality bit to define forward
200  const bool forward = ((itJet->hwQual() & 0x2) != 0);
201  L1GctJetCand JetCand(itJet->hwPt(), itJet->hwPhi(), itJet->hwEta(),
202  false, forward,0, 0, itBX);
203  //L1GctJetCand(unsigned rank, unsigned phi, unsigned eta,
204  // bool isTau, bool isFor, uint16_t block, uint16_t index, int16_t bx);
205  if(forward) {
206  if(forCount !=4 ){
207  forJetResult->push_back(JetCand);
208  forCount++;
209  }
210  }
211  else {
212  if(cenCount != 4){
213  cenJetResult->push_back(JetCand);
214  cenCount++;
215  }
216  }
217  }
218  forJetResult->resize(4*bxCounter);
219  cenJetResult->resize(4*bxCounter);
220  }
221 
222  bxCounter = 0;
223  for(int itBX=EtSum->getFirstBX(); itBX<=EtSum->getLastBX(); ++itBX){
224  bxCounter++;
225  //looping over EtSum elments with a specific BX
226  for (EtSumBxCollection::const_iterator itEtSum = EtSum->begin(itBX);
227  itEtSum != EtSum->end(itBX); ++itEtSum){
228 
229  if (EtSum::EtSumType::kMissingEt == itEtSum->getType()){
230  L1GctEtMiss Cand(itEtSum->hwPt(), itEtSum->hwPhi(), itEtSum->hwQual()&0x1, itBX);
231  etMissResult->push_back(Cand);
232  }else if (EtSum::EtSumType::kMissingHt == itEtSum->getType()){
233  L1GctHtMiss Cand(itEtSum->hwPt(), itEtSum->hwPhi(), itEtSum->hwQual()&0x1, itBX);
234  htMissResult->push_back(Cand);
235  }else if (EtSum::EtSumType::kTotalEt == itEtSum->getType()){
236  L1GctEtTotal Cand(itEtSum->hwPt(), itEtSum->hwQual()&0x1, itBX);
237  etTotResult->push_back(Cand);
238  }else if (EtSum::EtSumType::kTotalHt == itEtSum->getType()){
239  L1GctEtHad Cand(itEtSum->hwPt(), itEtSum->hwQual()&0x1, itBX);
240  etHadResult->push_back(Cand);
241  }else {
242  LogError("l1t|stage 1 Converter") <<" Unknown EtSumType --- EtSum collection will not be saved...\n ";
243  }
244  }
245  etMissResult->resize(1*bxCounter);
246  htMissResult->resize(1*bxCounter);
247  etTotResult->resize(1*bxCounter);
248  etHadResult->resize(1*bxCounter);
249  }
250 
251  bxCounter = 0;
252  for(int itBX=HfSums->getFirstBX(); itBX<=HfSums->getLastBX(); ++itBX){
253  bxCounter++;
255  0,
256  0,
257  0,
258  0);
259  for (CaloSpareBxCollection::const_iterator itCaloSpare = HfSums->begin(itBX);
260  itCaloSpare != HfSums->end(itBX); ++itCaloSpare){
261  // if (CaloSpare::CaloSpareType::V2 == itCaloSpare->getType())
262  // {
263  // sum.setEtSum(3, itCaloSpare->hwPt());
264  // } else if (CaloSpare::CaloSpareType::Centrality == itCaloSpare->getType())
265  // {
266  // sum.setEtSum(0, itCaloSpare->hwPt());
267  // } else if (CaloSpare::CaloSpareType::Tau == itCaloSpare->getType())
268  // {
269  // sum.setEtSum(0, itCaloSpare->hwPt() & 0x7);
270  // sum.setEtSum(1, (itCaloSpare->hwPt() >> 3) & 0x7);
271  // sum.setEtSum(2, (itCaloSpare->hwPt() >> 6) & 0x7);
272  // sum.setEtSum(3, (itCaloSpare->hwPt() >> 9) & 0x7);
273  // }
274  for(int i = 0; i < 4; i++)
275  {
276  sum.setEtSum(i, itCaloSpare->GetRing(i));
277  }
278  }
279  hfRingEtSumResult->push_back(sum);
280 
281  hfRingEtSumResult->resize(1*bxCounter);
282  //no hfBitCounts yet
283  hfBitCountResult->resize(1*bxCounter);
284  }
285 
286  e.put(isoEmResult,"isoEm");
287  e.put(nonIsoEmResult,"nonIsoEm");
288  e.put(cenJetResult,"cenJets");
289  e.put(forJetResult,"forJets");
290  e.put(tauJetResult,"tauJets");
291  e.put(isoTauJetResult,"isoTauJets");
292  e.put(etTotResult);
293  e.put(etHadResult);
294  e.put(etMissResult);
295  e.put(htMissResult);
296  e.put(hfBitCountResult);
297  e.put(hfRingEtSumResult);
298 
299  e.put(internalJetResult);
300  e.put(internalEtSumResult);
301  e.put(internalHtMissResult);
302 }
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:449
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.