CMS 3D CMS Logo

List of all members | Public Member Functions | Private Member Functions | Private Attributes
l1t::L1ComparatorRun2 Class Reference

#include <L1ComparatorRun2.h>

Inheritance diagram for l1t::L1ComparatorRun2:
edm::EDProducer edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Member Functions

 L1ComparatorRun2 (const edm::ParameterSet &ps)
 
 ~L1ComparatorRun2 ()
 
- Public Member Functions inherited from edm::EDProducer
 EDProducer ()
 
ModuleDescription const & moduleDescription () const
 
virtual ~EDProducer ()
 
- Public Member Functions inherited from edm::ProducerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
std::vector< edm::ProductResolverIndex > const & indiciesForPutProducts (BranchType iBranchType) const
 
 ProducerBase ()
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
std::function< void(BranchDescription const &)> registrationCallback () const
 used by the fwk to register list of products More...
 
void resolvePutIndicies (BranchType iBranchType, std::unordered_multimap< std::string, edm::ProductResolverIndex > const &iIndicies, std::string const &moduleLabel)
 
virtual ~ProducerBase () noexcept(false)
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
 EDConsumerBase ()
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
 EDConsumerBase (EDConsumerBase &&)=default
 
ProductResolverIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
std::vector< ProductResolverIndexAndSkipBit > const & itemsToGetFromEvent () const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
bool registeredToConsume (ProductResolverIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
virtual ~EDConsumerBase () noexcept(false)
 

Private Member Functions

virtual void produce (edm::Event &, edm::EventSetup const &)
 

Private Attributes

int bxMax_
 
int bxMin_
 
edm::EDGetToken CaloTowerDataToken_
 
edm::EDGetToken CaloTowerEmulToken_
 
bool doLayer1_
 
bool doLayer2_
 
edm::EDGetToken EGammaDataToken_
 
edm::EDGetToken EGammaEmulToken_
 
edm::EDGetToken EtSumDataToken_
 
edm::EDGetToken EtSumEmulToken_
 
edm::EDGetToken JetDataToken_
 
edm::EDGetToken JetEmulToken_
 
edm::EDGetToken TauDataToken_
 
edm::EDGetToken TauEmulToken_
 

Additional Inherited Members

- Public Types inherited from edm::EDProducer
typedef EDProducer ModuleType
 
- Public Types inherited from edm::ProducerBase
typedef ProductRegistryHelper::TypeLabelList TypeLabelList
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Static Public Member Functions inherited from edm::EDProducer
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 
- 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 40 of file L1ComparatorRun2.h.

Constructor & Destructor Documentation

L1ComparatorRun2::L1ComparatorRun2 ( const edm::ParameterSet ps)
explicit

Definition at line 7 of file L1ComparatorRun2.cc.

References edm::ParameterSet::getParameter().

7  {
8 
9  produces<L1DataEmulResultBxCollection>();
10 
11  JetDataToken_ = consumes<JetBxCollection>(ps.getParameter<InputTag>("JetData"));
12  JetEmulToken_ = consumes<JetBxCollection>(ps.getParameter<InputTag>("JetEmul"));
13  EGammaDataToken_ = consumes<EGammaBxCollection>(ps.getParameter<InputTag>("EGammaData"));
14  EGammaEmulToken_ = consumes<EGammaBxCollection>(ps.getParameter<InputTag>("EGammaEmul"));
15  TauDataToken_ = consumes<TauBxCollection>(ps.getParameter<InputTag>("TauData"));
16  TauEmulToken_ = consumes<TauBxCollection>(ps.getParameter<InputTag>("TauEmul"));
17  EtSumDataToken_ = consumes<EtSumBxCollection>(ps.getParameter<InputTag>("EtSumData"));
18  EtSumEmulToken_ = consumes<EtSumBxCollection>(ps.getParameter<InputTag>("EtSumEmul"));
19  CaloTowerDataToken_ = consumes<CaloTowerBxCollection>(ps.getParameter<InputTag>("CaloTowerData"));
20  CaloTowerEmulToken_ = consumes<CaloTowerBxCollection>(ps.getParameter<InputTag>("CaloTowerEmul"));
21  bxMax_ = ps.getParameter<int>("bxMax");
22  bxMin_ = ps.getParameter<int>("bxMin");
23  doLayer2_ = ps.getParameter<bool>("doLayer2");
24  doLayer1_ = ps.getParameter<bool>("doLayer1");
25 }
edm::EDGetToken JetDataToken_
T getParameter(std::string const &) const
edm::EDGetToken TauDataToken_
edm::EDGetToken CaloTowerDataToken_
edm::EDGetToken EtSumEmulToken_
edm::EDGetToken JetEmulToken_
edm::EDGetToken TauEmulToken_
edm::EDGetToken EGammaDataToken_
edm::EDGetToken EGammaEmulToken_
edm::EDGetToken CaloTowerEmulToken_
edm::EDGetToken EtSumDataToken_
L1ComparatorRun2::~L1ComparatorRun2 ( )

Definition at line 27 of file L1ComparatorRun2.cc.

27 {}

Member Function Documentation

void L1ComparatorRun2::produce ( edm::Event ,
edm::EventSetup const &   
)
privatevirtual

Implements edm::EDProducer.

Definition at line 30 of file L1ComparatorRun2.cc.

References BXVector< T >::begin(), SoftLeptonByDistance_cfi::distance, BXVector< T >::end(), RemoveAddSevLevel::flag, edm::Event::getByToken(), eostools::move(), edm::Event::put(), mps_fire::result, BXVector< T >::size(), and findQualityFiles::size.

31 {
32  unique_ptr<L1DataEmulResultBxCollection> RESULT (new L1DataEmulResultBxCollection);
33 
34  if(doLayer2_){
35 
36  for(int bx = bxMin_; bx<=bxMax_; bx++){
37 
38  Handle<JetBxCollection> jet_data;
39  Handle<JetBxCollection> jet_emul;
40 
41  iEvent.getByToken(JetDataToken_,jet_data);
42  iEvent.getByToken(JetEmulToken_,jet_emul);
43 
44  int size = (jet_data->size(bx)>jet_emul->size(bx)) ? jet_data->size(bx) : jet_emul->size(bx);
45 
46  int dataonly = size-jet_emul->size(bx);
47  int emulonly = size-jet_data->size(bx);
48 
49  int ptgood = 0;
50  int locgood = 0;
51  int good = 0;
52  int compared = 0;
53 
54  for (JetBxCollection::const_iterator itd = jet_data->begin(bx); itd!=jet_data->end(bx); itd++){
55  for (JetBxCollection::const_iterator ite = jet_emul->begin(bx); ite!=jet_emul->end(bx); ite++){
56  if(distance(jet_data->begin(bx), itd)==distance(jet_emul->begin(bx), ite)){
57  compared+=1;
58  if (itd->hwPt() == ite->hwPt()) ptgood +=1;
59  if (itd->hwEta() == ite->hwEta() && itd->hwPhi() == ite->hwPhi()) locgood +=1;
60  if (itd->hwPt() == ite->hwPt() && itd->hwEta() == ite->hwEta() && itd->hwPhi() == ite->hwPhi()) good +=1;
61  }
62  }
63  }
64 
65  int ptbad = compared-ptgood;
66  int locbad = compared-locgood;
67  int bad = size-good;
68 
69  bool flag = (bad==0) ? true : false;
70 
71  L1DataEmulResult result(flag, ptbad, locbad, bad, dataonly, emulonly, 0, 0, "JetBxCollection");
72 
73  RESULT->push_back(bx, result);
74  }
75  }
76 
79 
80  iEvent.getByToken(EGammaDataToken_,eg_data);
81  iEvent.getByToken(EGammaEmulToken_,eg_emul);
82 
83  if(doLayer2_){
84 
85  for(int bx = bxMin_; bx<=bxMax_; bx++){
86 
87  int size = (eg_data->size(bx)>eg_emul->size(bx)) ? eg_data->size(bx) : eg_emul->size(bx);
88 
89  int dataonly = size-eg_emul->size(bx);
90  int emulonly = size-eg_data->size(bx);
91 
92  int ptgood = 0;
93  int locgood = 0;
94  int good = 0;
95  int compared = 0;
96 
97  for (EGammaBxCollection::const_iterator itd = eg_data->begin(bx); itd!=eg_data->end(bx); itd++){
98  for (EGammaBxCollection::const_iterator ite = eg_emul->begin(bx); ite!=eg_emul->end(bx); ite++){
99  if(distance(eg_data->begin(bx), itd)==distance(eg_emul->begin(bx), ite)){
100  compared+=1;
101  if (itd->hwPt() == ite->hwPt()) ptgood +=1;
102  if (itd->hwEta() == ite->hwEta() && itd->hwPhi() == ite->hwPhi()) locgood +=1;
103  if (itd->hwPt() == ite->hwPt() && itd->hwEta() == ite->hwEta() && itd->hwPhi() == ite->hwPhi() && itd->hwIso()==ite->hwIso()) good +=1;
104  }
105  }
106  }
107 
108  int ptbad = compared-ptgood;
109  int locbad = compared-locgood;
110  int bad = size-good;
111 
112  bool flag = (bad==0) ? true : false;
113 
114  L1DataEmulResult result(flag, ptbad, locbad, bad, dataonly, emulonly, 0, 0, "EGammaBxCollection");
115 
116  RESULT->push_back(bx, result);
117  }
118  }
119 
120  Handle<TauBxCollection> tau_data;
121  Handle<TauBxCollection> tau_emul;
122 
123  iEvent.getByToken(TauDataToken_,tau_data);
124  iEvent.getByToken(TauEmulToken_,tau_emul);
125 
126  if(doLayer2_){
127 
128  for(int bx = bxMin_; bx<=bxMax_; bx++){
129 
130  int size = (tau_data->size(bx)>tau_emul->size(bx)) ? tau_data->size(bx) : tau_emul->size(bx);
131 
132  int dataonly = size-tau_emul->size(bx);
133  int emulonly = size-tau_data->size(bx);
134 
135  int ptgood = 0;
136  int locgood = 0;
137  int good = 0;
138  int compared = 0;
139 
140  for (TauBxCollection::const_iterator itd = tau_data->begin(bx); itd!=tau_data->end(bx); itd++){
141  for (TauBxCollection::const_iterator ite = tau_emul->begin(bx); ite!=tau_emul->end(bx); ite++){
142  if(distance(tau_data->begin(bx), itd)==distance(tau_emul->begin(bx), ite)){
143  compared+=1;
144  if (itd->hwPt() == ite->hwPt()) ptgood +=1;
145  if (itd->hwEta() == ite->hwEta() && itd->hwPhi() == ite->hwPhi()) locgood +=1;
146  if (itd->hwPt() == ite->hwPt() && itd->hwEta() == ite->hwEta() && itd->hwPhi() == ite->hwPhi() && itd->hwIso()==ite->hwIso()) good +=1;
147  }
148  }
149  }
150 
151  int ptbad = compared-ptgood;
152  int locbad = compared-locgood;
153  int bad = size-good;
154 
155  bool flag = (bad==0) ? true : false;
156 
157  L1DataEmulResult result(flag, ptbad, locbad, bad, dataonly, emulonly, 0, 0, "TauBxCollection");
158 
159  RESULT->push_back(bx, result);
160  }
161  }
162 
165 
166  iEvent.getByToken(EtSumDataToken_,et_data);
167  iEvent.getByToken(EtSumEmulToken_,et_emul);
168 
169  if(doLayer2_){
170 
171  for(int bx = bxMin_; bx<=bxMax_; bx++){
172 
173  int size = (et_data->size(bx)>et_emul->size(bx)) ? et_data->size(bx) : et_emul->size(bx);
174 
175  int dataonly = size-et_emul->size(bx);
176  int emulonly = size-et_data->size(bx);
177 
178  int ptgood = 0;
179  int locgood = 0;
180  int good = 0;
181  int compared = 0;
182 
183  for (EtSumBxCollection::const_iterator itd = et_data->begin(bx); itd!=et_data->end(bx); itd++){
184  for (EtSumBxCollection::const_iterator ite = et_emul->begin(bx); ite!=et_emul->end(bx); ite++){
185  if(distance(et_data->begin(bx), itd)==distance(et_emul->begin(bx), ite)){
186  compared+=1;
187  if (itd->hwPt() == ite->hwPt()) ptgood +=1;
188  if (itd->hwEta() == ite->hwEta() && itd->hwPhi() == ite->hwPhi()) locgood +=1;
189  if (itd->hwPt() == ite->hwPt() && itd->hwEta() == ite->hwEta() && itd->hwPhi() == ite->hwPhi() && itd->getType()==ite->getType()) good +=1;
190  }
191  }
192  }
193 
194  int ptbad = compared-ptgood;
195  int locbad = compared-locgood;
196  int bad = size-good;
197 
198  bool flag = (bad==0) ? true : false;
199 
200  L1DataEmulResult result(flag, ptbad, locbad, bad, dataonly, emulonly, 0, 0, "EtSumBxCollection");
201 
202  RESULT->push_back(bx, result);
203  }
204  }
205 
208 
209  iEvent.getByToken(CaloTowerDataToken_,tower_data);
210  iEvent.getByToken(CaloTowerEmulToken_,tower_emul);
211 
212  if(doLayer1_){
213 
214  for(int bx = bxMin_; bx<=bxMax_; bx++){
215 
216  int size = (tower_data->size(bx)>tower_emul->size(bx)) ? tower_data->size(bx) : tower_emul->size(bx);
217 
218  int dataonly = size-tower_emul->size(bx);
219  int emulonly = size-tower_data->size(bx);
220 
221  int ptgood = 0;
222  int locgood = 0;
223  int good = 0;
224  int compared = 0;
225  int hcalgood = 0;
226  int ecalgood = 0;
227 
228  for (CaloTowerBxCollection::const_iterator itd = tower_data->begin(bx); itd!=tower_data->end(bx); itd++){
229  for (CaloTowerBxCollection::const_iterator ite = tower_emul->begin(bx); ite!=tower_emul->end(bx); ite++){
230  if(distance(tower_data->begin(bx), itd)==distance(tower_emul->begin(bx), ite)){
231  compared+=1;
232  if (itd->hwPt() == ite->hwPt()) ptgood +=1;
233  if (itd->hwEta() == ite->hwEta() && itd->hwPhi() == ite->hwPhi()) locgood +=1;
234  if (itd->hwEtHad() == ite->hwEtHad()) hcalgood +=1;
235  if (itd->hwEtEm() == ite->hwEtEm()) ecalgood +=1;
236  if (itd->hwPt() == ite->hwPt() && itd->hwEta() == ite->hwEta() && itd->hwPhi() == ite->hwPhi() && itd->hwEtEm()==ite->hwEtEm() && itd->hwEtHad()==ite->hwEtHad()) good +=1;
237  }
238  }
239  }
240 
241  int ptbad = compared-ptgood;
242  int locbad = compared-locgood;
243  int bad = size-good;
244  int hcalbad = compared-hcalgood;
245  int ecalbad = compared-ecalgood;
246 
247  bool flag = (bad==0) ? true : false;
248 
249  L1DataEmulResult result(flag, ptbad, locbad, bad, dataonly, emulonly, hcalbad, ecalbad, "CaloTowerBxCollection");
250 
251  RESULT->push_back(bx, result);
252  }
253  }
254 
255  iEvent.put(std::move(RESULT));
256 }
size
Write out results.
const_iterator end(int bx) const
edm::EDGetToken JetDataToken_
unsigned size(int bx) const
edm::EDGetToken TauDataToken_
edm::EDGetToken CaloTowerDataToken_
edm::EDGetToken EtSumEmulToken_
int iEvent
Definition: GenABIO.cc:230
edm::EDGetToken JetEmulToken_
edm::EDGetToken TauEmulToken_
edm::EDGetToken EGammaDataToken_
edm::EDGetToken EGammaEmulToken_
edm::EDGetToken CaloTowerEmulToken_
const_iterator begin(int bx) const
def move(src, dest)
Definition: eostools.py:510
edm::EDGetToken EtSumDataToken_
std::vector< Jet >::const_iterator const_iterator
Definition: BXVector.h:20

Member Data Documentation

int l1t::L1ComparatorRun2::bxMax_
private

Definition at line 62 of file L1ComparatorRun2.h.

int l1t::L1ComparatorRun2::bxMin_
private

Definition at line 63 of file L1ComparatorRun2.h.

edm::EDGetToken l1t::L1ComparatorRun2::CaloTowerDataToken_
private

Definition at line 59 of file L1ComparatorRun2.h.

edm::EDGetToken l1t::L1ComparatorRun2::CaloTowerEmulToken_
private

Definition at line 60 of file L1ComparatorRun2.h.

bool l1t::L1ComparatorRun2::doLayer1_
private

Definition at line 66 of file L1ComparatorRun2.h.

bool l1t::L1ComparatorRun2::doLayer2_
private

Definition at line 65 of file L1ComparatorRun2.h.

edm::EDGetToken l1t::L1ComparatorRun2::EGammaDataToken_
private

Definition at line 53 of file L1ComparatorRun2.h.

edm::EDGetToken l1t::L1ComparatorRun2::EGammaEmulToken_
private

Definition at line 54 of file L1ComparatorRun2.h.

edm::EDGetToken l1t::L1ComparatorRun2::EtSumDataToken_
private

Definition at line 57 of file L1ComparatorRun2.h.

edm::EDGetToken l1t::L1ComparatorRun2::EtSumEmulToken_
private

Definition at line 58 of file L1ComparatorRun2.h.

edm::EDGetToken l1t::L1ComparatorRun2::JetDataToken_
private

Definition at line 51 of file L1ComparatorRun2.h.

edm::EDGetToken l1t::L1ComparatorRun2::JetEmulToken_
private

Definition at line 52 of file L1ComparatorRun2.h.

edm::EDGetToken l1t::L1ComparatorRun2::TauDataToken_
private

Definition at line 55 of file L1ComparatorRun2.h.

edm::EDGetToken l1t::L1ComparatorRun2::TauEmulToken_
private

Definition at line 56 of file L1ComparatorRun2.h.