CMS 3D CMS Logo

List of all members | Public Member Functions | Private Member Functions | Private Attributes
CSCDigiValidator Class Reference

#include <UserCode/CSCDigiValidator/src/CSCDigiValidator.cc>

Inheritance diagram for CSCDigiValidator:
edm::EDFilter edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Member Functions

 CSCDigiValidator (const edm::ParameterSet &)
 
 ~CSCDigiValidator () override
 
- Public Member Functions inherited from edm::EDFilter
 EDFilter ()
 
SerialTaskQueueglobalLuminosityBlocksQueue ()
 
SerialTaskQueueglobalRunsQueue ()
 
ModuleDescription const & moduleDescription () const
 
 ~EDFilter () override
 
- 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 ()
 
std::vector< edm::ProductResolverIndex > const & putTokenIndexToProductResolverIndex () const
 
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, ModuleToResolverIndicies const &iIndicies, std::string const &moduleLabel)
 
 ~ProducerBase () noexcept(false) override
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
void convertCurrentProcessAlias (std::string const &processName)
 Convert "@currentProcess" in InputTag process names to the actual current process name. More...
 
 EDConsumerBase ()
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
 EDConsumerBase (EDConsumerBase &&)=default
 
ESProxyIndex const * esGetTokenIndices (edm::Transition iTrans) const
 
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 & itemsToGetFrom (BranchType iType) 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
 
ProductResolverIndexAndSkipBit uncheckedIndexFrom (EDGetToken) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
void updateLookup (eventsetup::ESRecordsToProxyIndices const &)
 
virtual ~EDConsumerBase () noexcept(false)
 

Private Member Functions

void beginJob () override
 
void endJob () override
 
bool filter (edm::Event &, const edm::EventSetup &) override
 
std::vector< CSCComparatorDigirelabelCompDigis (const CSCChamberMap *m, CSCDetId _id, std::vector< CSCComparatorDigi >::const_iterator b, std::vector< CSCComparatorDigi >::const_iterator e)
 
std::vector< CSCStripDigirelabelStripDigis (const CSCChamberMap *, CSCDetId, std::vector< CSCStripDigi >::const_iterator, std::vector< CSCStripDigi >::const_iterator)
 
std::vector< CSCStripDigisanitizeStripDigis (std::vector< CSCStripDigi >::const_iterator, std::vector< CSCStripDigi >::const_iterator)
 
std::vector< CSCWireDigisanitizeWireDigis (std::vector< CSCWireDigi >::const_iterator, std::vector< CSCWireDigi >::const_iterator)
 
std::vector< CSCComparatorDigizeroSupCompDigis (std::vector< CSCComparatorDigi >::const_iterator, std::vector< CSCComparatorDigi >::const_iterator)
 
std::vector< CSCStripDigizeroSupStripDigis (std::vector< CSCStripDigi >::const_iterator, std::vector< CSCStripDigi >::const_iterator)
 

Private Attributes

edm::EDGetTokenT< CSCALCTDigiCollectional1_token
 
edm::EDGetTokenT< CSCALCTDigiCollectional2_token
 
edm::InputTag alct1
 
edm::InputTag alct2
 
edm::EDGetTokenT< CSCComparatorDigiCollectioncd1_token
 
edm::EDGetTokenT< CSCComparatorDigiCollectioncd2_token
 
edm::EDGetTokenT< CSCCLCTDigiCollectioncl1_token
 
edm::EDGetTokenT< CSCCLCTDigiCollectioncl2_token
 
edm::InputTag clct1
 
edm::InputTag clct2
 
edm::EDGetTokenT< CSCCorrelatedLCTDigiCollectionco1_token
 
edm::EDGetTokenT< CSCCorrelatedLCTDigiCollectionco2_token
 
edm::InputTag comp1
 
edm::InputTag comp2
 
edm::InputTag csctf1
 
edm::InputTag csctf2
 
edm::InputTag csctfstubs1
 
edm::InputTag csctfstubs2
 
edm::InputTag lct1
 
edm::InputTag lct2
 
bool reorderStrips
 
edm::EDGetTokenT< CSCStripDigiCollectionsd1_token
 
edm::EDGetTokenT< CSCStripDigiCollectionsd2_token
 
edm::InputTag strip1
 
edm::InputTag strip2
 
edm::EDGetTokenT< L1CSCTrackCollectiontr1_token
 
edm::EDGetTokenT< L1CSCTrackCollectiontr2_token
 
edm::EDGetTokenT< CSCTriggerContainer< csctf::TrackStub > > ts1_token
 
edm::EDGetTokenT< CSCTriggerContainer< csctf::TrackStub > > ts2_token
 
edm::EDGetTokenT< CSCWireDigiCollectionwd1_token
 
edm::EDGetTokenT< CSCWireDigiCollectionwd2_token
 
edm::InputTag wire1
 
edm::InputTag wire2
 

Additional Inherited Members

- Public Types inherited from edm::EDFilter
typedef EDFilter ModuleType
 
- Public Types inherited from edm::ProducerBase
using ModuleToResolverIndicies = std::unordered_multimap< std::string, std::tuple< edm::TypeID const *, const char *, edm::ProductResolverIndex >>
 
typedef ProductRegistryHelper::TypeLabelList TypeLabelList
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Static Public Member Functions inherited from edm::EDFilter
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &)
 
static bool wantsGlobalLuminosityBlocks ()
 
static bool wantsGlobalRuns ()
 
static bool wantsStreamLuminosityBlocks ()
 
static bool wantsStreamRuns ()
 
- 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 ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes ()
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes (ESInputTag const &tag)
 
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 35 of file CSCDigiValidator.h.

Constructor & Destructor Documentation

CSCDigiValidator::CSCDigiValidator ( const edm::ParameterSet iConfig)
explicit

Definition at line 26 of file CSCDigiValidator.cc.

References al1_token, al2_token, cd1_token, cd2_token, cl1_token, cl2_token, co1_token, co2_token, edm::ParameterSet::getParameter(), sd1_token, sd2_token, tr1_token, tr2_token, ts1_token, ts2_token, wd1_token, and wd2_token.

27 {
28  wd1_token = consumes<CSCWireDigiCollection>( iConfig.getParameter<edm::InputTag>("inputWire") );
29  wd2_token = consumes<CSCWireDigiCollection>( iConfig.getParameter<edm::InputTag>("repackWire") );
30  sd1_token = consumes<CSCStripDigiCollection>( iConfig.getParameter<edm::InputTag>("inputStrip") );
31  sd2_token = consumes<CSCStripDigiCollection>( iConfig.getParameter<edm::InputTag>("inputStrip") );
32  cd1_token = consumes<CSCComparatorDigiCollection>( iConfig.getParameter<edm::InputTag>("inputComp") );
33  cd2_token = consumes<CSCComparatorDigiCollection>( iConfig.getParameter<edm::InputTag>("RepackComp") );
34  al1_token = consumes<CSCALCTDigiCollection>( iConfig.getParameter<edm::InputTag>("inputALCT") );
35  al2_token = consumes<CSCALCTDigiCollection>( iConfig.getParameter<edm::InputTag>("repackALCT") );
36  cl1_token = consumes<CSCCLCTDigiCollection>( iConfig.getParameter<edm::InputTag>("inputCLCT") );
37  cl2_token = consumes<CSCCLCTDigiCollection>( iConfig.getParameter<edm::InputTag>("repackCLCT") );
38  co1_token = consumes<CSCCorrelatedLCTDigiCollection>( iConfig.getParameter<edm::InputTag>("inputCorrLCT") );
39  co2_token = consumes<CSCCorrelatedLCTDigiCollection>( iConfig.getParameter<edm::InputTag>("repackCorrLCT") );
40  tr1_token = consumes<L1CSCTrackCollection>( iConfig.getParameter<edm::InputTag>("inputCSCTF") );
41  tr2_token = consumes<L1CSCTrackCollection>( iConfig.getParameter<edm::InputTag>("repackCSCTF") );
42  ts1_token = consumes<CSCTriggerContainer<csctf::TrackStub> >( iConfig.getParameter<edm::InputTag>("inputCSCTFStubs") );
43  ts2_token = consumes<CSCTriggerContainer<csctf::TrackStub> >( iConfig.getParameter<edm::InputTag>("repackCSCTFStubs") );
44 
45  // reorderStrips(iConfig.getUntrackedParameter<bool>("applyStripReordering",true))
46 
47 }
T getParameter(std::string const &) const
edm::EDGetTokenT< CSCComparatorDigiCollection > cd1_token
edm::EDGetTokenT< CSCStripDigiCollection > sd1_token
edm::EDGetTokenT< CSCCLCTDigiCollection > cl1_token
edm::EDGetTokenT< CSCCLCTDigiCollection > cl2_token
edm::EDGetTokenT< CSCALCTDigiCollection > al1_token
edm::EDGetTokenT< CSCCorrelatedLCTDigiCollection > co2_token
edm::EDGetTokenT< CSCALCTDigiCollection > al2_token
edm::EDGetTokenT< L1CSCTrackCollection > tr1_token
edm::EDGetTokenT< CSCTriggerContainer< csctf::TrackStub > > ts1_token
edm::EDGetTokenT< CSCWireDigiCollection > wd1_token
edm::EDGetTokenT< CSCStripDigiCollection > sd2_token
edm::EDGetTokenT< CSCWireDigiCollection > wd2_token
edm::EDGetTokenT< CSCTriggerContainer< csctf::TrackStub > > ts2_token
edm::EDGetTokenT< CSCCorrelatedLCTDigiCollection > co1_token
edm::EDGetTokenT< CSCComparatorDigiCollection > cd2_token
edm::EDGetTokenT< L1CSCTrackCollection > tr2_token
CSCDigiValidator::~CSCDigiValidator ( )
override

Definition at line 49 of file CSCDigiValidator.cc.

50 {
51 }

Member Function Documentation

void CSCDigiValidator::beginJob ( void  )
overrideprivatevirtual

Reimplemented from edm::EDFilter.

Definition at line 988 of file CSCDigiValidator.cc.

989 {
990 }
void CSCDigiValidator::endJob ( void  )
overrideprivatevirtual

Reimplemented from edm::EDFilter.

Definition at line 993 of file CSCDigiValidator.cc.

994 {
995 }
bool CSCDigiValidator::filter ( edm::Event iEvent,
const edm::EventSetup iSetup 
)
overrideprivate

Definition at line 54 of file CSCDigiValidator.cc.

References photons_cff::_id, a, al1_token, al2_token, CustomPhysics_cfi::amplitude, b, EnergyCorrector::c, GetRecoTauVFromDQM_MC_cff::cl, cl1_token, cl2_token, co1_token, co2_token, gather_cfg::cout, cuy::cv, TauDecayModes::dec, dt, MillePedeFileConverter_cfg::e, CSCTriggerContainer< T >::get(), edm::EventSetup::get(), edm::Event::getByToken(), mps_fire::i, gen::k, genParticles_cff::map, SiStripPI::max, min(), muonCSCDigis_cfi::pedestal, edm::ESHandle< T >::product(), CSCTriggerContainer< T >::push_back(), relabelCompDigis(), relabelStripDigis(), alignCSCRings::s, sanitizeWireDigis(), sd1_token, sd2_token, edm::second(), findQualityFiles::size, RecoTauPiZeroBuilderPlugins_cfi::strips, pfDeepBoostedJetPreprocessParams_cfi::sv, tr1_token, tr2_token, l1t::tracks, ts1_token, ts2_token, w, wd1_token, wd2_token, muonCSCDigis_cfi::wires, zeroSupCompDigis(), zeroSupStripDigis(), and SurfaceOrientation::zplus.

Referenced by Vispa.Plugins.Browser.BrowserTabController.BrowserTabController::filter(), Vispa.Plugins.Browser.BrowserTabController.BrowserTabController::find(), Vispa.Plugins.Browser.BrowserTabController.BrowserTabController::setDataAccessor(), and Vispa.Plugins.Browser.BrowserTabController.BrowserTabController::switchCenterView().

55 {
56  bool _err = false;
57  using namespace edm;
58 
59  typedef std::map<CSCDetId,
60  std::pair<std::vector<CSCWireDigi>,std::vector<CSCWireDigi> > >
61  matchingDetWireCollection;
62  typedef std::map<CSCDetId,
63  std::pair<std::vector<CSCStripDigi>,std::vector<CSCStripDigi> > >
64  matchingDetStripCollection;
65  typedef std::map<CSCDetId,
66  std::pair<std::vector<CSCComparatorDigi>,std::vector<CSCComparatorDigi> > >
67  matchingDetComparatorCollection;
68  typedef std::map<CSCDetId,
69  std::pair<std::vector<CSCCLCTDigi>,std::vector<CSCCLCTDigi> > >
70  matchingDetCLCTCollection;
71  typedef std::map<CSCDetId,
72  std::pair<std::vector<CSCALCTDigi>,std::vector<CSCALCTDigi> > >
73  matchingDetALCTCollection;
74  typedef std::map<CSCDetId,
75  std::pair<std::vector<CSCCorrelatedLCTDigi>,std::vector<CSCCorrelatedLCTDigi> > >
76  matchingDetLCTCollection;
77 
79  iSetup.get<CSCChamberMapRcd>().get(hcham);
80  const CSCChamberMap* theMapping = hcham.product();
81 
85  Handle<CSCCLCTDigiCollection> _clct, _sclct;
86  Handle<CSCALCTDigiCollection> _alct, _salct;
88  Handle<L1CSCTrackCollection> _trk, _strk;
90 
91  // get wire digis before and after unpacking
92  iEvent.getByToken( wd1_token, _swi );
93  iEvent.getByToken( wd2_token, _wi );
94 
95  //get strip digis before and after unpacking
96  iEvent.getByToken( sd1_token, _sst );
97  iEvent.getByToken( sd2_token, _st );
98 
99  //get comparator digis before and after unpacking
100  iEvent.getByToken( co1_token, _scmp );
101  iEvent.getByToken( co2_token, _cmp );
102 
103  //get clcts
104  iEvent.getByToken( cl1_token, _sclct );
105  iEvent.getByToken( cl2_token, _clct );
106 
107  //get alcts
108  iEvent.getByToken( al1_token, _salct );
109  iEvent.getByToken( al2_token, _alct );
110 
111  //get corr lcts
112  iEvent.getByToken( co1_token, _slct );
113  iEvent.getByToken( co2_token, _lct );
114 
115  //get l1 tracks
116  iEvent.getByToken( tr1_token, _strk );
117  iEvent.getByToken( tr2_token, _trk );
118 
119  //get DT stubs for L1 Tracks
120  iEvent.getByToken( ts1_token, _sdt );
121  iEvent.getByToken( ts2_token, _dt );
122 
123 
125  wi = _wi->begin(), swi= _swi->begin();
127  st = _st->begin(), sst = _sst->begin();
129  cmp = _cmp->begin(), scmp = _scmp->begin();
131  clct = _clct->begin(), sclct = _sclct->begin();
133  alct = _alct->begin(), salct = _salct->begin();
135  lct = _lct->begin(), slct = _slct->begin();
136  L1CSCTrackCollection::const_iterator
137  trk = _trk->begin(), strk = _strk->begin();
138  std::vector<csctf::TrackStub>::const_iterator
139  dt = _dt->get().begin(), sdt = _sdt->get().begin();
140  // WARNING 5_0_X
141  dt++; dt--; sdt++; sdt--;
142 
143  //per detID, create lists of various digi types
144  matchingDetWireCollection wires;
145  matchingDetStripCollection strips;
146  matchingDetComparatorCollection comps;
147  matchingDetCLCTCollection clcts;
148  matchingDetALCTCollection alcts;
149  matchingDetLCTCollection lcts,trackstubs;
151 
152  //wires
153  for(;wi != _wi->end();++wi)
154  {
156  b=(*wi).second.first,e=(*wi).second.second;
157  std::vector<CSCWireDigi>::iterator
158  beg=wires[(*wi).first].first.end();
159  wires[(*wi).first].first.insert(beg,b,e);
160  }
161  for(;swi != _swi->end();++swi)
162  {
164  b=(*swi).second.first,e=(*swi).second.second;
165  //convert sim ring 4(ME1/a) to ring 1
166  CSCDetId _id = (*swi).first;
167  if((*swi).first.ring() == 4)
168  _id = CSCDetId((*swi).first.endcap(),(*swi).first.station(),
169  1, (*swi).first.chamber(),(*swi).first.layer());
170 
171  std::vector<CSCWireDigi>::iterator
172  beg=wires[_id].second.end();
173 
174  wires[_id].second.insert(beg,b,e);
175  // automatically combine wire digis after each insertion
176  wires[_id].second = sanitizeWireDigis(wires[_id].second.begin(),
177  wires[_id].second.end());
178  }
179 
180  //strips
181  for(;st != _st->end();++st)
182  {
184  b=(*st).second.first,e=(*st).second.second;
185  std::vector<CSCStripDigi>::iterator
186  beg=strips[(*st).first].first.end();
187 
188  //need to remove strips with no active ADCs
189  std::vector<CSCStripDigi> zs = zeroSupStripDigis(b,e);
190 
191  strips[(*st).first].first.insert(beg,zs.begin(),zs.end());
192  }
193  for(;sst != _sst->end();++sst)
194  {
196  b=(*sst).second.first,e=(*sst).second.second;
197  // conversion of ring 4->1 not necessary here
198  CSCDetId _id = (*sst).first;
199  //if((*sst).first.ring() == 4)
200  // _id = CSCDetId((*sst).first.endcap(),(*sst).first.station(),
201  // 1, (*sst).first.chamber(),(*sst).first.layer());
202 
203  std::vector<CSCStripDigi>::iterator
204  beg=strips[_id].second.end();
205 
206  std::vector<CSCStripDigi> relab = relabelStripDigis(theMapping,(*sst).first,b,e);
207 
208  strips[_id].second.insert(beg,relab.begin(),relab.end());
209  //strips[_id].second.insert(beg,b,e);
210  }
211 
212  //comparators
213  for(;cmp != _cmp->end();++cmp)
214  {
216  b=(*cmp).second.first,e=(*cmp).second.second;
217  std::vector<CSCComparatorDigi>::iterator
218  beg=comps[(*cmp).first].first.end();
219 
220  comps[(*cmp).first].first.insert(beg,b,e);
221  }
222  for(;scmp != _scmp->end();++scmp)
223  {
225  b=(*scmp).second.first,e=(*scmp).second.second;
226  // convert sim ring 4 (ME1/a) to ring 1
227  CSCDetId _id = (*scmp).first;
228  if((*scmp).first.ring() == 4)
229  _id = CSCDetId((*scmp).first.endcap(),(*scmp).first.station(),
230  1, (*scmp).first.chamber(),(*scmp).first.layer());
231 
232  std::vector<CSCComparatorDigi>::iterator
233  beg=comps[_id].second.begin();
234 
235  if((*scmp).first.ring()==4)
236  beg=comps[_id].second.end();
237 
238  std::vector<CSCComparatorDigi> zs =
239  zeroSupCompDigis(b,e);
240 
241  std::vector<CSCComparatorDigi> relab =
242  relabelCompDigis(theMapping,(*scmp).first,
243  zs.begin(),
244  zs.end());
245 
246  comps[_id].second.insert(beg,relab.begin(),relab.end());
247  }
248 
249  //CLCTs
250  for(;clct != _clct->end();++clct)
251  {
253  b=(*clct).second.first,e=(*clct).second.second;
254  std::vector<CSCCLCTDigi>::iterator
255  beg=clcts[(*clct).first].first.end();
256 
257  clcts[(*clct).first].first.insert(beg,b,e);
258  }
259  for(;sclct != _sclct->end();++sclct)
260  {
262  b=(*sclct).second.first,e=(*sclct).second.second;
263  // convert sim ring 4 (ME1/a) to ring 1
264  CSCDetId _id = (*sclct).first;
265  if((*sclct).first.ring() == 4)
266  _id = CSCDetId((*sclct).first.endcap(),(*sclct).first.station(),
267  1, (*sclct).first.chamber(),(*sclct).first.layer());
268 
269  std::vector<CSCCLCTDigi>::iterator
270  beg=clcts[_id].second.begin();
271 
272  if((*sclct).first.ring()==4)
273  beg=clcts[_id].second.end();
274 
275  clcts[_id].second.insert(beg,b,e);
276  }
277 
278  //ALCTs
279  for(;alct != _alct->end();++alct)
280  {
282  b=(*alct).second.first,e=(*alct).second.second;
283  std::vector<CSCALCTDigi>::iterator
284  beg=alcts[(*alct).first].first.end();
285 
286  alcts[(*alct).first].first.insert(beg,b,e);
287  }
288  for(;salct != _salct->end();++salct)
289  {
291  b=(*salct).second.first,e=(*salct).second.second;
292  // convert sim ring 4 (ME1/a) to ring 1
293  CSCDetId _id = (*salct).first;
294  if((*salct).first.ring() == 4)
295  _id = CSCDetId((*salct).first.endcap(),(*salct).first.station(),
296  1, (*salct).first.chamber(),(*salct).first.layer());
297 
298  std::vector<CSCALCTDigi>::iterator
299  beg=alcts[_id].second.begin();
300 
301  if((*salct).first.ring()==4)
302  beg=alcts[_id].second.end();
303 
304  alcts[_id].second.insert(beg,b,e);
305  }
306 
307  // Correlated LCTs
308  for(;lct != _lct->end();++lct)
309  {
311  b=(*lct).second.first,e=(*lct).second.second;
312  std::vector<CSCCorrelatedLCTDigi>::iterator
313  beg=lcts[(*lct).first].first.end();
314 
315  lcts[(*lct).first].first.insert(beg,b,e);
316  }
317  for(;slct != _slct->end();++slct)
318  {
320  b=(*slct).second.first,e=(*slct).second.second;
321  // convert sim ring 4 (ME1/a) to ring 1
322  CSCDetId _id = (*slct).first;
323  if((*slct).first.ring() == 4)
324  _id = CSCDetId((*slct).first.endcap(),(*slct).first.station(),
325  1, (*slct).first.chamber(),(*slct).first.layer());
326 
327  std::vector<CSCCorrelatedLCTDigi>::iterator
328  beg=lcts[_id].second.begin();
329 
330  if((*slct).first.ring()==4)
331  beg=lcts[_id].second.end();
332 
333  lcts[_id].second.insert(beg,b,e);
334  }
335  // remove attached LCT digis from tracks, should be put into their own collection and checked separately
336  for(; trk != _trk->end(); ++trk)
337  {
338  tracks.push_back(trk->first);
339 
340  }
341  for(;strk != _strk->end(); ++strk)
342  {
343  simtracks.push_back(strk->first);
344  }
345 
346  //now loop through each set and process if there are differences!
347  matchingDetWireCollection::const_iterator w;
348  matchingDetStripCollection::const_iterator s;
349  matchingDetComparatorCollection::const_iterator c;
350  matchingDetCLCTCollection::const_iterator cl;
351  matchingDetALCTCollection::const_iterator al;
352  matchingDetLCTCollection::const_iterator lc;
353 
354  for(w = wires.begin(); w != wires.end(); ++w)
355  {
356  if(w->second.first.size() != w->second.second.size())
357  {
358  std::cout << "Major error! # of wire digis in detID: " << w->first
359  << " is not equal between sim and unpacked!" << std::endl;
360  //eventually do more in this case!
361 
362  std::vector<CSCWireDigi> a = w->second.second;
363  std::vector<CSCWireDigi> b = w->second.first;
364  std::cout << "SIM OUTPUT:" << std::endl;
365  for(std::vector<CSCWireDigi>::const_iterator i = a.begin(); i != a.end(); ++i)
366  i->print();
367  std::cout << "UNPACKER OUTPUT:" << std::endl;
368  for(std::vector<CSCWireDigi>::const_iterator i = b.begin(); i != b.end(); ++i)
369  i->print();
370 
371  }
372  int max = std::min(w->second.first.size(),w->second.second.size());
373  std::vector<CSCWireDigi> cv = w->second.first;
374  std::vector<CSCWireDigi> sv = w->second.second;
375  for(int i = 0; i < max; ++i)
376  {
377  if(sv[i].getWireGroup() != cv[i].getWireGroup())
378  {
379  std::cout << "In detId: " << w->first << std::endl;
380  std::cout << "Wire Groups do not match: " << sv[i].getWireGroup()
381  << " != " << cv[i].getWireGroup() << std::endl;
382  }
383  if(sv[i].getTimeBin() != cv[i].getTimeBin())
384  {
385  std::cout << "In detId: " << w->first << std::endl;
386  std::cout << "First Time Bins do not match: " << sv[i].getTimeBin()
387  << " != " << cv[i].getTimeBin() << std::endl;
388  }
389  if(sv[i].getTimeBinWord() != cv[i].getTimeBinWord())
390  {
391  std::cout << "In detId: " << w->first << std::endl;
392  std::cout << "Time Bin Words do not match: " << sv[i].getTimeBinWord()
393  << " != " << cv[i].getTimeBinWord() << std::endl;
394  }
395  }
396  }
397  for(s = strips.begin(); s != strips.end(); ++s)
398  {
399  if(s->second.first.size() != s->second.second.size())
400  {
401  std::cout << "Major error! # of strip digis in detID: " << s->first
402  << " is not equal between sim and unpacked!" << std::endl;
403  //eventually do more in this case!
404 
405  std::vector<CSCStripDigi> a = s->second.second;
406  std::vector<CSCStripDigi> b = s->second.first;
407  std::cout << "SIM OUTPUT:" << std::endl;
408  for(std::vector<CSCStripDigi>::const_iterator i = a.begin(); i != a.end(); ++i)
409  i->print();
410  std::cout << "UNPACKER OUTPUT:" << std::endl;
411  for(std::vector<CSCStripDigi>::const_iterator i = b.begin(); i != b.end(); ++i)
412  i->print();
413  }
414  int max = std::min(s->second.first.size(),s->second.second.size());
415  std::vector<CSCStripDigi> cv = s->second.first;
416  std::vector<CSCStripDigi> sv = s->second.second;
417  for(int i = 0; i < max; ++i)
418  {
419  bool me1a = s->first.station()==1 && s->first.ring()==4;
420  bool me1b = s->first.station()==1 && s->first.ring()==1;
421  bool zplus = s->first.endcap()==1;
422  int k=i;
423 
424  if(me1a && zplus) k=max-i-1;
425  if(me1b && !zplus) k=max-i-1;
426 
427  if(sv[k].getStrip() != cv[i].getStrip())
428  {
429  std::cout << "In detId: " << s->first << std::endl;
430  std::cout << "Strips do not match: " << sv[k].getStrip()
431  << " != " << cv[i].getStrip() << std::endl;
432  }
433  if(sv[k].getADCCounts().size() != cv[i].getADCCounts().size())
434  {
435  std::cout << "In detId: " << s->first << std::endl;
436  std::cout << "ADC Readouts not of equal size!" << std::endl;
437  std::cout << sv[k].getADCCounts().size() << ' '
438  << cv[i].getADCCounts().size() << std::endl;
439  }
440  else
441  {
442  std::vector<int> sADC = sv[k].getADCCounts();
443  std::vector<int> uADC = cv[i].getADCCounts();
444 
445  for(unsigned iadc = 0; iadc < sADC.size(); ++iadc)
446  if(sADC[iadc] != uADC[iadc])
447  {
448  std::cout << "In detId: " << s->first << std::endl;
449  std::cout << "ADC counts not equal at index: " << iadc << std::endl
450  << std::hex <<sADC[iadc] << " != " << uADC[iadc] << std::dec
451  << std::endl;
452  }
453  }
454  if(sv[k].getADCOverflow().size() != cv[i].getADCOverflow().size())
455  {
456  std::cout << "In detId: " << s->first << std::endl;
457  std::cout << "ADC Overflows not of equal size!" << std::endl;
458  std::cout << sv[k].getADCOverflow().size() << ' '
459  << cv[i].getADCOverflow().size() << std::endl;
460  }
461  else
462  {
463  std::vector<uint16_t> sADC = sv[k].getADCOverflow();
464  std::vector<uint16_t> uADC = cv[i].getADCOverflow();
465 
466  for(unsigned iadc = 0; iadc < sADC.size(); ++iadc)
467  if(sADC[iadc] != uADC[iadc])
468  {
469  std::cout << "In detId: " << s->first << std::endl;
470  std::cout << "ADC overflows not equal at index: " << iadc << std::endl
471  << std::hex <<sADC[iadc] << " != " << uADC[iadc] << std::dec
472  << std::endl;
473  }
474  }
475  if(sv[k].getOverlappedSample().size() != cv[i].getOverlappedSample().size())
476  {
477  std::cout << "In detId: " << s->first << std::endl;
478  std::cout << "Overlapped Samples not of equal size!" << std::endl;
479  std::cout << sv[k].getOverlappedSample().size() << ' '
480  << cv[i].getOverlappedSample().size() << std::endl;
481  }
482  else
483  {
484  std::vector<uint16_t> sADC = sv[k].getOverlappedSample();
485  std::vector<uint16_t> uADC = cv[i].getOverlappedSample();
486 
487  for(unsigned iadc = 0; iadc < sADC.size(); ++iadc)
488  if(sADC[iadc] != uADC[iadc])
489  {
490  std::cout << "In detId: " << s->first << std::endl;
491  std::cout << "Overlapped Samples not equal at index: " << iadc << std::endl
492  << std::hex <<sADC[iadc] << " != " << uADC[iadc] << std::dec
493  << std::endl;
494  }
495  }
496  if(sv[k].getErrorstat().size() != cv[i].getErrorstat().size())
497  {
498  std::cout << "In detId: " << s->first << std::endl;
499  std::cout << "Errorstat not of equal size!" << std::endl;
500  std::cout << sv[k].getErrorstat().size() << ' '
501  << cv[i].getErrorstat().size() << std::endl;
502  }
503  else
504  {
505  std::vector<uint16_t> sADC = sv[k].getErrorstat();
506  std::vector<uint16_t> uADC = cv[i].getErrorstat();
507 
508  for(unsigned iadc = 0; iadc < sADC.size(); ++iadc)
509  if(sADC[iadc] != uADC[iadc])
510  {
511  std::cout << "In detId: " << s->first << std::endl;
512  std::cout << "Errorstat not equal at index: " << iadc << std::endl
513  << std::hex <<sADC[iadc] << " != " << uADC[iadc] << std::dec
514  << std::endl;
515  }
516  }
517  if(sv[k].pedestal() != cv[i].pedestal())
518  {
519  std::cout << "In detId: " << s->first << std::endl;
520  std::cout << "Pedestals not equal: " << sv[k].pedestal() << " != "
521  << cv[i].pedestal() << std::endl;
522  }
523  if(sv[k].amplitude() != cv[i].amplitude())
524  {
525  std::cout << "In detId: " << s->first << std::endl;
526  std::cout << "Amplitudes not equal: " << sv[k].amplitude() << " != "
527  << cv[i].amplitude() << std::endl;
528  }
529  }
530  }
531  for(c = comps.begin(); c != comps.end(); ++c)
532  {
533  if(c->second.first.size() != c->second.second.size())
534  {
535  std::cout << "Major error! # of comparator digis in detID: " << c->first
536  << " is not equal between sim and unpacked!" << std::endl;
537  //eventually do more in this case!
538 
539  std::vector<CSCComparatorDigi> a = c->second.second;
540  std::vector<CSCComparatorDigi> b = c->second.first;
541  std::cout << "SIM OUTPUT:" << std::endl;
542  for(std::vector<CSCComparatorDigi>::const_iterator i = a.begin(); i != a.end(); ++i)
543  i->print();
544  std::cout << "UNPACKER OUTPUT:" << std::endl;
545  for(std::vector<CSCComparatorDigi>::const_iterator i = b.begin(); i != b.end(); ++i)
546  i->print();
547  }
548  int max = std::min(c->second.first.size(),c->second.second.size());
549  std::vector<CSCComparatorDigi> cv = c->second.first;
550  std::vector<CSCComparatorDigi> sv = c->second.second;
551  for(int i = 0; i < max; ++i)
552  {
553  if(sv[i].getStrip() != cv[i].getStrip())
554  {
555  std::cout << "In detId: " << s->first << std::endl;
556  std::cout << "Comparator strips do not match: " << sv[i].getStrip()
557  << " != " << cv[i].getStrip() << std::endl;
558  }
559  if(sv[i].getComparator() != cv[i].getComparator())
560  {
561  std::cout << "In detId: " << c->first << std::endl;
562  std::cout << "Comparators do not match: " << sv[i].getComparator()
563  << " != " << cv[i].getComparator() << std::endl;
564  }
565  if(sv[i].getTimeBinWord() != cv[i].getTimeBinWord())
566  {
567  std::cout << "In detId: " << c->first << std::endl;
568  std::cout << "Comparator time bins words do not match: " << sv[i].getTimeBinWord()
569  << " != " << cv[i].getTimeBinWord() << std::endl;
570  }
571  }
572  }
573  for(cl = clcts.begin(); cl != clcts.end(); ++cl)
574  {
575  if(cl->second.first.size() != cl->second.second.size())
576  {
577  std::cout << "Major error! # of CLCT digis in detID: " << cl->first
578  << " is not equal between sim and unpacked!" << std::endl;
579  //eventually do more in this case!
580 
581  std::vector<CSCCLCTDigi> a = cl->second.second;
582  std::vector<CSCCLCTDigi> b = cl->second.first;
583  std::cout << "SIM OUTPUT:" << std::endl;
584  for(std::vector<CSCCLCTDigi>::const_iterator i = a.begin(); i != a.end(); ++i)
585  i->print();
586  std::cout << "UNPACKER OUTPUT:" << std::endl;
587  for(std::vector<CSCCLCTDigi>::const_iterator i = b.begin(); i != b.end(); ++i)
588  i->print();
589  }
590  int max = std::min(cl->second.first.size(),cl->second.second.size());
591  std::vector<CSCCLCTDigi> cv = cl->second.first;
592  std::vector<CSCCLCTDigi> sv = cl->second.second;
593  for(int i = 0; i < max; ++i)
594  {
595  if(cv[i].getKeyStrip() != sv[i].getKeyStrip())
596  {
597  std::cout << "In detId: " << cl->first << std::endl;
598  std::cout << "CLCT key strips do not match: " << sv[i].getKeyStrip()
599  << " != " << cv[i].getKeyStrip() << std::endl;
600  }
601  if(cv[i].getStrip() != sv[i].getStrip())
602  {
603  std::cout << "In detId: " << cl->first << std::endl;
604  std::cout << "CLCT strips do not match: " << sv[i].getStrip()
605  << " != " << cv[i].getStrip() << std::endl;
606  }
607  if(cv[i].isValid() != sv[i].isValid())
608  {
609  std::cout << "In detId: " << cl->first << std::endl;
610  std::cout << "CLCT Valid bits do not match: " << sv[i].isValid()
611  << " != " << cv[i].isValid() << std::endl;
612  }
613  if(cv[i].getQuality() != sv[i].getQuality())
614  {
615  std::cout << "In detId: " << cl->first << std::endl;
616  std::cout << "CLCT qualities do not match: " << sv[i].getQuality()
617  << " != " << cv[i].getQuality() << std::endl;
618  }
619  if(cv[i].getPattern() != sv[i].getPattern())
620  {
621  std::cout << "In detId: " << cl->first << std::endl;
622  std::cout << "CLCT patterns do not match: " << sv[i].getPattern()
623  << " != " << cv[i].getPattern() << std::endl;
624  }
625  if(cv[i].getStripType() != sv[i].getStripType())
626  {
627  std::cout << "In detId: " << cl->first << std::endl;
628  std::cout << "CLCT strip types do not match: " << sv[i].getStripType()
629  << " != " << cv[i].getStripType() << std::endl;
630  }
631  if(cv[i].getBend() != sv[i].getBend())
632  {
633  std::cout << "In detId: " << cl->first << std::endl;
634  std::cout << "CLCT bends do not match: " << sv[i].getBend()
635  << " != " << cv[i].getBend() << std::endl;
636  }
637  if(cv[i].getCFEB() != sv[i].getCFEB())
638  {
639  std::cout << "In detId: " << cl->first << std::endl;
640  std::cout << "CLCT CFEBs do not match: " << sv[i].getCFEB()
641  << " != " << cv[i].getCFEB() << std::endl;
642  }
643  if(((short)cv[i].getBX()) != ((short)sv[i].getBX()) - 4)
644  {
645  std::cout << "In detId: " << cl->first << std::endl;
646  std::cout << "CLCT BX do not match: " << sv[i].getBX() - 4
647  << " != " << cv[i].getBX() << std::endl;
648  }
649  if(cv[i].getFullBX() != sv[i].getFullBX())
650  {
651  std::cout << "In detId: " << cl->first << std::endl;
652  std::cout << "CLCT Full BX do not match: " << sv[i].getFullBX()
653  << " != " << cv[i].getFullBX() << std::endl;
654  }
655  if(cv[i].getTrknmb() != sv[i].getTrknmb())
656  {
657  std::cout << "In detId: " << cl->first << std::endl;
658  std::cout << "CLCT Track numbers do not match: " << sv[i].getTrknmb()
659  << " != " << cv[i].getTrknmb() << std::endl;
660  }
661  }
662  }
663  for(al = alcts.begin(); al != alcts.end(); ++al)
664  {
665  if(al->second.first.size() != al->second.second.size())
666  {
667  std::cout << "Major error! # of ALCT digis in detID: " << al->first
668  << " is not equal between sim and unpacked!" << std::endl;
669  //eventually do more in this case!
670 
671  std::vector<CSCALCTDigi> a = al->second.second;
672  std::vector<CSCALCTDigi> b = al->second.first;
673  std::cout << "SIM OUTPUT:" << std::endl;
674  for(std::vector<CSCALCTDigi>::const_iterator i = a.begin(); i != a.end(); ++i)
675  i->print();
676  std::cout << "UNPACKER OUTPUT:" << std::endl;
677  for(std::vector<CSCALCTDigi>::const_iterator i = b.begin(); i != b.end(); ++i)
678  i->print();
679  }
680  int max = std::min(al->second.first.size(),al->second.second.size());
681  std::vector<CSCALCTDigi> cv = al->second.first;
682  std::vector<CSCALCTDigi> sv = al->second.second;
683  for(int i = 0; i < max; ++i)
684  {
685  if(cv[i].getKeyWG() != sv[i].getKeyWG())
686  {
687  std::cout << "In detId: " << al->first << std::endl;
688  std::cout << "ALCT key wire groups do not match: " << sv[i].getKeyWG()
689  << " != " << cv[i].getKeyWG() << std::endl;
690  }
691  if(cv[i].isValid() != sv[i].isValid())
692  {
693  std::cout << "In detId: " << al->first << std::endl;
694  std::cout << "ALCT Valid bits do not match: " << sv[i].isValid()
695  << " != " << cv[i].isValid() << std::endl;
696  }
697  if(cv[i].getQuality() != sv[i].getQuality())
698  {
699  std::cout << "In detId: " << al->first << std::endl;
700  std::cout << "ALCT qualities do not match: " << sv[i].getQuality()
701  << " != " << cv[i].getQuality() << std::endl;
702  }
703  if(cv[i].getAccelerator() != sv[i].getAccelerator())
704  {
705  std::cout << "In detId: " << al->first << std::endl;
706  std::cout << "ALCT accelerator bits do not match: " << sv[i].getAccelerator()
707  << " != " << cv[i].getAccelerator() << std::endl;
708  }
709  if(cv[i].getCollisionB() != sv[i].getCollisionB())
710  {
711  std::cout << "In detId: " << al->first << std::endl;
712  std::cout << "ALCT CollisionB flags do not match: " << sv[i].getCollisionB()
713  << " != " << cv[i].getCollisionB() << std::endl;
714  }
715  if((cv[i].getBX()) != (sv[i].getBX()))
716  {
717  std::cout << "In detId: " << al->first << std::endl;
718  std::cout << "ALCT BX do not match: " << sv[i].getBX()
719  << " != " << cv[i].getBX() << std::endl;
720  }
721  if(cv[i].getFullBX() != sv[i].getFullBX())
722  {
723  std::cout << "In detId: " << cl->first << std::endl;
724  std::cout << "ALCT Full BX do not match: " << sv[i].getFullBX()
725  << " != " << cv[i].getFullBX() << std::endl;
726  }
727  }
728  }
729  for(lc = lcts.begin(); lc != lcts.end(); ++lc)
730  {
731  if(lc->second.first.size() != lc->second.second.size())
732  {
733  std::cout << "Major error! # of Correlated LCT digis in detID: " << lc->first
734  << " is not equal between sim and unpacked!" << std::endl;
735  //eventually do more in this case!
736 
737  std::vector<CSCCorrelatedLCTDigi> a = lc->second.second;
738  std::vector<CSCCorrelatedLCTDigi> b = lc->second.first;
739  std::cout << "SIM OUTPUT:" << std::endl;
740  for(std::vector<CSCCorrelatedLCTDigi>::const_iterator i = a.begin(); i != a.end(); ++i)
741  i->print();
742  std::cout << "UNPACKER OUTPUT:" << std::endl;
743  for(std::vector<CSCCorrelatedLCTDigi>::const_iterator i = b.begin(); i != b.end(); ++i)
744  i->print();
745  }
746  int max = std::min(lc->second.first.size(),lc->second.second.size());
747  std::vector<CSCCorrelatedLCTDigi> cv = lc->second.first;
748  std::vector<CSCCorrelatedLCTDigi> sv = lc->second.second;
749  for(int i = 0; i < max; ++i)
750  {
751  if(cv[i].getStrip() != sv[i].getStrip())
752  {
753  std::cout << "In detId: " << lc->first << std::endl;
754  std::cout << "Correlated LCT strips do not match: " << sv[i].getStrip()
755  << " != " << cv[i].getStrip() << std::endl;
756  }
757  if(cv[i].getKeyWG() != sv[i].getKeyWG())
758  {
759  std::cout << "In detId: " << lc->first << std::endl;
760  std::cout << "Correlated LCT key wire groups do not match: " << sv[i].getKeyWG()
761  << " != " << cv[i].getKeyWG() << std::endl;
762  }
763  if(cv[i].isValid() != sv[i].isValid())
764  {
765  std::cout << "In detId: " << lc->first << std::endl;
766  std::cout << "Correlated LCT Valid bits do not match: " << sv[i].isValid()
767  << " != " << cv[i].isValid() << std::endl;
768  }
769  if(cv[i].getQuality() != sv[i].getQuality())
770  {
771  std::cout << "In detId: " << lc->first << std::endl;
772  std::cout << "Correlated LCT qualities do not match: " << sv[i].getQuality()
773  << " != " << cv[i].getQuality() << std::endl;
774  }
775  if(cv[i].getPattern() != sv[i].getPattern())
776  {
777  std::cout << "In detId: " << lc->first << std::endl;
778  std::cout << "Correlated LCT ALCT patterns do not match: " << sv[i].getPattern()
779  << " != " << cv[i].getPattern() << std::endl;
780  }
781  if(cv[i].getCLCTPattern() != sv[i].getCLCTPattern())
782  {
783  std::cout << "In detId: " << lc->first << std::endl;
784  std::cout << "Correlated LCT CLCT patterns do not match: " << sv[i].getCLCTPattern()
785  << " != " << cv[i].getCLCTPattern() << std::endl;
786  }
787  if(cv[i].getStripType() != sv[i].getStripType())
788  {
789  std::cout << "In detId: " << lc->first << std::endl;
790  std::cout << "Correlated LCT strip types do not match: " << sv[i].getStripType()
791  << " != " << cv[i].getStripType() << std::endl;
792  }
793  if(cv[i].getBend() != sv[i].getBend())
794  {
795  std::cout << "In detId: " << lc->first << std::endl;
796  std::cout << "Correlated LCT bends do not match: " << sv[i].getBend()
797  << " != " << cv[i].getBend() << std::endl;
798  }
799  if(cv[i].getMPCLink() != sv[i].getMPCLink())
800  {
801  std::cout << "In detId: " << lc->first << std::endl;
802  std::cout << "Correlated LCT MPC Links do not match: " << sv[i].getMPCLink()
803  << " != " << cv[i].getMPCLink() << std::endl;
804  }
805  if((cv[i].getBX()) != (sv[i].getBX()-6))
806  {
807  std::cout << "In detId: " << lc->first << std::endl;
808  std::cout << "Correlated LCT BX do not match: " << sv[i].getBX()-6
809  << " != " << cv[i].getBX() << std::endl;
810  }
811  if(cv[i].getCSCID() != sv[i].getCSCID())
812  {
813  std::cout << "In detId: " << lc->first << std::endl;
814  std::cout << "Correlated LCT CSCIDs do not match: " << sv[i].getCSCID()
815  << " != " << cv[i].getCSCID() << std::endl;
816  }
817  if(cv[i].getBX0() != sv[i].getBX0())
818  {
819  std::cout << "In detId: " << lc->first << std::endl;
820  std::cout << "Correlated LCT BX0s do not match: " << sv[i].getBX0()
821  << " != " << cv[i].getBX0() << std::endl;
822  }
823  if(cv[i].getSyncErr() != sv[i].getSyncErr())
824  {
825  std::cout << "In detId: " << lc->first << std::endl;
826  std::cout << "Correlated LCT SyncErrs do not match: " << sv[i].getSyncErr()
827  << " != " << cv[i].getSyncErr() << std::endl;
828  }
829  if(cv[i].getTrknmb() != sv[i].getTrknmb())
830  {
831  std::cout << "In detId: " << lc->first << std::endl;
832  std::cout << "Correlated LCT Track numbers do not match: " << sv[i].getTrknmb()
833  << " != " << cv[i].getTrknmb() << std::endl;
834  }
835  }
836  }
837  if(tracks.get().size() != simtracks.get().size())
838  {
839  std::cout << "Major error! # of L1 Tracks is not equal between sim and unpacked!" << std::endl;
840  std::vector<csc::L1Track> a = simtracks.get();
841  std::vector<csc::L1Track> b = tracks.get();
842  std::cout << "SIM OUTPUT:" << std::endl;
843  for(std::vector<csc::L1Track>::const_iterator i = a.begin(); i != a.end(); ++i)
844  i->print();
845  std::cout << "UNPACKER OUTPUT:" << std::endl;
846  for(std::vector<csc::L1Track>::const_iterator i = b.begin(); i != b.end(); ++i)
847  i->print();
848  }
849 
850 
851  return _err;
852 }
size
Write out results.
float dt
Definition: AMPTWrapper.h:126
std::vector< T > get() const
std::vector< CSCComparatorDigi > zeroSupCompDigis(std::vector< CSCComparatorDigi >::const_iterator, std::vector< CSCComparatorDigi >::const_iterator)
const double w
Definition: UKUtility.cc:23
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:517
std::vector< CSCComparatorDigi > relabelCompDigis(const CSCChamberMap *m, CSCDetId _id, std::vector< CSCComparatorDigi >::const_iterator b, std::vector< CSCComparatorDigi >::const_iterator e)
edm::EDGetTokenT< CSCStripDigiCollection > sd1_token
edm::EDGetTokenT< CSCCLCTDigiCollection > cl1_token
edm::EDGetTokenT< CSCCLCTDigiCollection > cl2_token
edm::EDGetTokenT< CSCALCTDigiCollection > al1_token
cv
Definition: cuy.py:364
edm::EDGetTokenT< CSCCorrelatedLCTDigiCollection > co2_token
edm::EDGetTokenT< CSCALCTDigiCollection > al2_token
void push_back(const T &data)
U second(std::pair< T, U > const &p)
edm::EDGetTokenT< L1CSCTrackCollection > tr1_token
T min(T a, T b)
Definition: MathUtil.h:58
edm::EDGetTokenT< CSCTriggerContainer< csctf::TrackStub > > ts1_token
edm::EDGetTokenT< CSCWireDigiCollection > wd1_token
edm::EDGetTokenT< CSCStripDigiCollection > sd2_token
edm::EDGetTokenT< CSCWireDigiCollection > wd2_token
int k[5][pyjets_maxn]
edm::EDGetTokenT< CSCTriggerContainer< csctf::TrackStub > > ts2_token
double b
Definition: hdecay.h:120
std::vector< DigiType >::const_iterator const_iterator
edm::EDGetTokenT< CSCCorrelatedLCTDigiCollection > co1_token
edm::EDGetTokenT< L1CSCTrackCollection > tr2_token
HLT enums.
std::vector< CSCStripDigi > zeroSupStripDigis(std::vector< CSCStripDigi >::const_iterator, std::vector< CSCStripDigi >::const_iterator)
double a
Definition: hdecay.h:121
T get() const
Definition: EventSetup.h:71
std::vector< CSCWireDigi > sanitizeWireDigis(std::vector< CSCWireDigi >::const_iterator, std::vector< CSCWireDigi >::const_iterator)
T const * product() const
Definition: ESHandle.h:86
std::vector< CSCStripDigi > relabelStripDigis(const CSCChamberMap *, CSCDetId, std::vector< CSCStripDigi >::const_iterator, std::vector< CSCStripDigi >::const_iterator)
std::vector< CSCComparatorDigi > CSCDigiValidator::relabelCompDigis ( const CSCChamberMap m,
CSCDetId  _id,
std::vector< CSCComparatorDigi >::const_iterator  b,
std::vector< CSCComparatorDigi >::const_iterator  e 
)
private

Definition at line 915 of file CSCDigiValidator.cc.

References MillePedeFileConverter_cfg::e, mps_fire::i, CSCDetId::ring(), CSCDetId::station(), and digitizers_cfi::strip.

Referenced by filter().

918 {
919  std::vector<CSCComparatorDigi> _r; // the vector of comp digis with appropriate strip #'s
920 
921  bool me1a = _id.station()==1 && _id.ring()==4;
922  //bool zplus = _id.endcap()==1;
923  //bool me1b = _id.station()==1 && _id.ring()==1;
924 
925  for(std::vector<CSCComparatorDigi>::const_iterator i = b; i != e; ++i)
926  {
927  int strip=i->getStrip();
928 
929  // if(me1a&&zplus) strip=17-strip;
930  // if(me1b&&!zplus) strip=65-strip;
931  if(me1a) strip+=64;
932 
933  _r.push_back(CSCComparatorDigi(strip,i->getComparator(),
934  i->getTimeBinWord()));
935  }
936  return _r;
937 }
int ring() const
Definition: CSCDetId.h:75
double b
Definition: hdecay.h:120
int station() const
Definition: CSCDetId.h:86
std::vector< CSCStripDigi > CSCDigiValidator::relabelStripDigis ( const CSCChamberMap m,
CSCDetId  _id,
std::vector< CSCStripDigi >::const_iterator  b,
std::vector< CSCStripDigi >::const_iterator  e 
)
private

Definition at line 890 of file CSCDigiValidator.cc.

References MillePedeFileConverter_cfg::e, mps_fire::i, and digitizers_cfi::strip.

Referenced by filter().

893 {
894  std::vector<CSCStripDigi> _r; // the vector of strip digis with appropriate strip #'s
895 
896  //bool me1a = _id.station()==1 && _id.ring()==4;
897  //bool zplus = _id.endcap()==1;
898  //bool me1b = _id.station()==1 && _id.ring()==1;
899 
900  for(std::vector<CSCStripDigi>::const_iterator i = b; i != e; ++i)
901  {
902  int strip=i->getStrip();
903 
904  //if(me1a&&zplus) strip=17-strip;
905  //if(me1b&&!zplus) strip=(65-strip-1)%(m->dmb(_id)*16) + 1;
906  //if(me1a) strip+=64;
907 
908  _r.push_back(CSCStripDigi(strip,i->getADCCounts(),i->getADCOverflow(),
909  i->getOverlappedSample(),i->getErrorstat()));
910  }
911  return _r;
912 }
double b
Definition: hdecay.h:120
std::vector< CSCStripDigi > CSCDigiValidator::sanitizeStripDigis ( std::vector< CSCStripDigi >::const_iterator  b,
std::vector< CSCStripDigi >::const_iterator  e 
)
private

Definition at line 940 of file CSCDigiValidator.cc.

942 {
943  std::vector<CSCStripDigi> _r; // vector of digis in proper order
944 
945  return _r;
946 }
std::vector< CSCWireDigi > CSCDigiValidator::sanitizeWireDigis ( std::vector< CSCWireDigi >::const_iterator  b,
std::vector< CSCWireDigi >::const_iterator  e 
)
private

Definition at line 858 of file CSCDigiValidator.cc.

References edmIntegrityCheck::d, MillePedeFileConverter_cfg::e, mps_fire::i, and lumiQTWidget::t.

Referenced by filter().

860 {
861  typedef std::map<int,std::vector<CSCWireDigi> > wire2digi;
862 
863  std::vector<CSCWireDigi> _r; // the resulting vector of wire digis
864  wire2digi _wr2digis; // map of wires to a set of digis
865 
866  for(std::vector<CSCWireDigi>::const_iterator i = b; i != e; ++i)
867  _wr2digis[i->getWireGroup()].push_back(*i);
868 
869  for(wire2digi::const_iterator i = _wr2digis.begin(); i != _wr2digis.end(); ++i)
870  {
871  int wire = i->first;
872  unsigned tbin = 0x0;
873 
874  for(std::vector<CSCWireDigi>::const_iterator d = i->second.begin();
875  d != i->second.end(); ++d)
876  {
877  std::vector<int> binson = d->getTimeBinsOn();
878  for(std::vector<int>::const_iterator t = binson.begin();
879  t != binson.end(); ++t)
880  tbin |= 1<<(*t);
881  }
882 
883  _r.push_back(CSCWireDigi(wire,tbin));
884  }
885 
886  return _r;
887 }
double b
Definition: hdecay.h:120
std::vector< CSCComparatorDigi > CSCDigiValidator::zeroSupCompDigis ( std::vector< CSCComparatorDigi >::const_iterator  b,
std::vector< CSCComparatorDigi >::const_iterator  e 
)
private

Definition at line 970 of file CSCDigiValidator.cc.

References MillePedeFileConverter_cfg::e, and mps_fire::i.

Referenced by filter().

972 {
973  std::vector<CSCComparatorDigi> _r;
974 
975  for(std::vector<CSCComparatorDigi>::const_iterator i = b; i != e; ++i)
976  {
977  bool present = false;
978 
979  if(i->getTimeBin() < 10) present=true;
980 
981  if(present) _r.push_back(*i);
982  }
983 
984  return _r;
985 }
double b
Definition: hdecay.h:120
std::vector< CSCStripDigi > CSCDigiValidator::zeroSupStripDigis ( std::vector< CSCStripDigi >::const_iterator  b,
std::vector< CSCStripDigi >::const_iterator  e 
)
private

Definition at line 949 of file CSCDigiValidator.cc.

References a, MillePedeFileConverter_cfg::e, mps_fire::i, and beamvalidation::nonzero().

Referenced by filter().

951 {
952  std::vector<CSCStripDigi> _r; // zero-suppressed strip digis
953  std::vector<int> counts;
954 
955  for(std::vector<CSCStripDigi>::const_iterator i = b; i != e; ++i)
956  {
957  bool nonzero=false;
958  counts = i->getADCCounts();
959  for(std::vector<int>::const_iterator a = counts.begin(); a != counts.end(); ++a)
960  if((*a) != 0) nonzero = true;
961 
962  if(nonzero) _r.push_back(*i);
963  }
964 
965  return _r;
966 }
double b
Definition: hdecay.h:120
def nonzero(self)
double a
Definition: hdecay.h:121

Member Data Documentation

edm::EDGetTokenT<CSCALCTDigiCollection> CSCDigiValidator::al1_token
private

Definition at line 75 of file CSCDigiValidator.h.

Referenced by CSCDigiValidator(), and filter().

edm::EDGetTokenT<CSCALCTDigiCollection> CSCDigiValidator::al2_token
private

Definition at line 84 of file CSCDigiValidator.h.

Referenced by CSCDigiValidator(), and filter().

edm::InputTag CSCDigiValidator::alct1
private

Definition at line 67 of file CSCDigiValidator.h.

edm::InputTag CSCDigiValidator::alct2
private

Definition at line 68 of file CSCDigiValidator.h.

edm::EDGetTokenT<CSCComparatorDigiCollection> CSCDigiValidator::cd1_token
private

Definition at line 74 of file CSCDigiValidator.h.

Referenced by CSCDigiValidator().

edm::EDGetTokenT<CSCComparatorDigiCollection> CSCDigiValidator::cd2_token
private

Definition at line 83 of file CSCDigiValidator.h.

Referenced by CSCDigiValidator().

edm::EDGetTokenT<CSCCLCTDigiCollection> CSCDigiValidator::cl1_token
private

Definition at line 76 of file CSCDigiValidator.h.

Referenced by CSCDigiValidator(), and filter().

edm::EDGetTokenT<CSCCLCTDigiCollection> CSCDigiValidator::cl2_token
private

Definition at line 85 of file CSCDigiValidator.h.

Referenced by CSCDigiValidator(), and filter().

edm::InputTag CSCDigiValidator::clct1
private

Definition at line 67 of file CSCDigiValidator.h.

edm::InputTag CSCDigiValidator::clct2
private

Definition at line 68 of file CSCDigiValidator.h.

edm::EDGetTokenT<CSCCorrelatedLCTDigiCollection> CSCDigiValidator::co1_token
private

Definition at line 77 of file CSCDigiValidator.h.

Referenced by CSCDigiValidator(), and filter().

edm::EDGetTokenT<CSCCorrelatedLCTDigiCollection> CSCDigiValidator::co2_token
private

Definition at line 86 of file CSCDigiValidator.h.

Referenced by CSCDigiValidator(), and filter().

edm::InputTag CSCDigiValidator::comp1
private

Definition at line 67 of file CSCDigiValidator.h.

edm::InputTag CSCDigiValidator::comp2
private

Definition at line 68 of file CSCDigiValidator.h.

edm::InputTag CSCDigiValidator::csctf1
private

Definition at line 67 of file CSCDigiValidator.h.

edm::InputTag CSCDigiValidator::csctf2
private

Definition at line 68 of file CSCDigiValidator.h.

edm::InputTag CSCDigiValidator::csctfstubs1
private

Definition at line 67 of file CSCDigiValidator.h.

edm::InputTag CSCDigiValidator::csctfstubs2
private

Definition at line 68 of file CSCDigiValidator.h.

edm::InputTag CSCDigiValidator::lct1
private

Definition at line 67 of file CSCDigiValidator.h.

edm::InputTag CSCDigiValidator::lct2
private

Definition at line 68 of file CSCDigiValidator.h.

bool CSCDigiValidator::reorderStrips
private

Definition at line 70 of file CSCDigiValidator.h.

edm::EDGetTokenT<CSCStripDigiCollection> CSCDigiValidator::sd1_token
private

Definition at line 73 of file CSCDigiValidator.h.

Referenced by CSCDigiValidator(), and filter().

edm::EDGetTokenT<CSCStripDigiCollection> CSCDigiValidator::sd2_token
private

Definition at line 82 of file CSCDigiValidator.h.

Referenced by CSCDigiValidator(), and filter().

edm::InputTag CSCDigiValidator::strip1
private

Definition at line 67 of file CSCDigiValidator.h.

edm::InputTag CSCDigiValidator::strip2
private

Definition at line 68 of file CSCDigiValidator.h.

edm::EDGetTokenT<L1CSCTrackCollection> CSCDigiValidator::tr1_token
private

Definition at line 78 of file CSCDigiValidator.h.

Referenced by CSCDigiValidator(), and filter().

edm::EDGetTokenT<L1CSCTrackCollection> CSCDigiValidator::tr2_token
private

Definition at line 87 of file CSCDigiValidator.h.

Referenced by CSCDigiValidator(), and filter().

edm::EDGetTokenT<CSCTriggerContainer<csctf::TrackStub> > CSCDigiValidator::ts1_token
private

Definition at line 79 of file CSCDigiValidator.h.

Referenced by CSCDigiValidator(), and filter().

edm::EDGetTokenT<CSCTriggerContainer<csctf::TrackStub> > CSCDigiValidator::ts2_token
private

Definition at line 88 of file CSCDigiValidator.h.

Referenced by CSCDigiValidator(), and filter().

edm::EDGetTokenT<CSCWireDigiCollection> CSCDigiValidator::wd1_token
private

Definition at line 72 of file CSCDigiValidator.h.

Referenced by CSCDigiValidator(), and filter().

edm::EDGetTokenT<CSCWireDigiCollection> CSCDigiValidator::wd2_token
private

Definition at line 81 of file CSCDigiValidator.h.

Referenced by CSCDigiValidator(), and filter().

edm::InputTag CSCDigiValidator::wire1
private

Definition at line 67 of file CSCDigiValidator.h.

edm::InputTag CSCDigiValidator::wire2
private

Definition at line 68 of file CSCDigiValidator.h.