CMS 3D CMS Logo

List of all members | Public Member Functions | Private Types | Private Attributes
cms::DigitizerFP420 Class Reference

#include <DigitizerFP420.h>

Inheritance diagram for cms::DigitizerFP420:
edm::one::EDProducer<> edm::one::EDProducerBase edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Member Functions

 DigitizerFP420 (const edm::ParameterSet &conf)
 
void produce (edm::Event &e, const edm::EventSetup &c) override
 
 ~DigitizerFP420 () override
 
- Public Member Functions inherited from edm::one::EDProducer<>
 EDProducer ()=default
 
 EDProducer (const EDProducer &)=delete
 
SerialTaskQueueglobalLuminosityBlocksQueue () final
 
SerialTaskQueueglobalRunsQueue () final
 
bool hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginProcessBlocks () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndProcessBlocks () const final
 
bool hasAbilityToProduceInEndRuns () const final
 
const EDProduceroperator= (const EDProducer &)=delete
 
bool wantsGlobalLuminosityBlocks () const final
 
bool wantsGlobalRuns () const final
 
bool wantsInputProcessBlocks () const final
 
bool wantsProcessBlocks () const final
 
- Public Member Functions inherited from edm::one::EDProducerBase
 EDProducerBase ()
 
ModuleDescription const & moduleDescription () const
 
bool wantsStreamLuminosityBlocks () const
 
bool wantsStreamRuns () const
 
 ~EDProducerBase () 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
 
std::vector< bool > const & recordProvenanceList () 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)
 
TypeLabelList const & typeLabelList () const
 used by the fwk to register the list of products of this module More...
 
 ~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
 
std::vector< ESProxyIndex > const & esGetTokenIndicesVector (edm::Transition iTrans) const
 
std::vector< ESRecordIndex > const & esGetTokenRecordIndicesVector (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::array< std::vector< ModuleDescription const *> *, NumBranchTypes > &modulesAll, std::vector< ModuleProcessName > &modulesInPreviousProcesses, 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 selectInputProcessBlocks (ProductRegistry const &productRegistry, ProcessBlockHelperBase const &processBlockHelperBase)
 
ProductResolverIndexAndSkipBit uncheckedIndexFrom (EDGetToken) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
void updateLookup (eventsetup::ESRecordsToProxyIndices const &)
 
virtual ~EDConsumerBase () noexcept(false)
 

Private Types

typedef std::map< unsigned int, std::vector< PSimHit >, std::less< unsigned int > > simhit_map
 
typedef simhit_map::iterator simhit_map_iterator
 
typedef std::vector< std::string > vstring
 

Private Attributes

std::vector< HDigiFP420collector
 
edm::ParameterSet conf_
 
int dn0
 
int numStrips
 
int pn0
 
int rn0
 
simhit_map SimHitMap
 
int sn0
 
FP420DigiMainstripDigitizer_
 
vstring trackerContainers
 
int verbosity
 

Additional Inherited Members

- Public Types inherited from edm::one::EDProducerBase
typedef EDProducerBase 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::one::EDProducerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 
- Protected Member Functions inherited from edm::ProducerBase
template<Transition Tr = Transition::Event>
auto produces (std::string instanceName) noexcept
 declare what type of product will make and with which optional label More...
 
template<Transition B>
BranchAliasSetter produces (const TypeID &id, std::string instanceName=std::string(), bool recordProvenance=true)
 
template<BranchType B>
BranchAliasSetter produces (const TypeID &id, std::string instanceName=std::string(), bool recordProvenance=true)
 
BranchAliasSetter produces (const TypeID &id, std::string instanceName=std::string(), bool recordProvenance=true)
 
template<typename ProductType , Transition B>
BranchAliasSetterT< ProductType > produces (std::string instanceName)
 
template<class ProductType >
BranchAliasSetterT< ProductType > produces ()
 
template<typename ProductType , BranchType B>
BranchAliasSetterT< ProductType > produces (std::string instanceName)
 
template<typename ProductType , BranchType B>
BranchAliasSetterT< ProductType > produces ()
 
template<class ProductType >
BranchAliasSetterT< ProductType > produces (std::string instanceName)
 
template<typename ProductType , Transition B>
BranchAliasSetterT< ProductType > produces ()
 
template<Transition Tr = Transition::Event>
auto produces () noexcept
 
ProducesCollector producesCollector ()
 
- Protected Member Functions inherited from edm::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
template<BranchType B = InEvent>
EDConsumerBaseAdaptor< Bconsumes (edm::InputTag tag) noexcept
 
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<Transition Tr = Transition::Event>
constexpr auto esConsumes ()
 
template<Transition Tr = Transition::Event>
auto esConsumes (ESInputTag tag)
 
template<Transition Tr = Transition::Event>
ESGetTokenGeneric esConsumes (eventsetup::EventSetupRecordKey const &iRecord, eventsetup::DataKey const &iKey)
 Used with EventSetupRecord::doGet. More...
 
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)
 
void resetItemsToGetFrom (BranchType iType)
 

Detailed Description

Definition at line 31 of file DigitizerFP420.h.

Member Typedef Documentation

◆ simhit_map

typedef std::map<unsigned int, std::vector<PSimHit>, std::less<unsigned int> > cms::DigitizerFP420::simhit_map
private

Definition at line 41 of file DigitizerFP420.h.

◆ simhit_map_iterator

typedef simhit_map::iterator cms::DigitizerFP420::simhit_map_iterator
private

Definition at line 42 of file DigitizerFP420.h.

◆ vstring

typedef std::vector<std::string> cms::DigitizerFP420::vstring
private

Definition at line 40 of file DigitizerFP420.h.

Constructor & Destructor Documentation

◆ DigitizerFP420()

cms::DigitizerFP420::DigitizerFP420 ( const edm::ParameterSet conf)
explicit

Definition at line 61 of file DigitizerFP420.cc.

References SiStripOfflineCRack_cfg::alias, conf_, gather_cfg::cout, dn0, edm::ParameterSet::getParameter(), edm::ParameterSet::getUntrackedParameter(), pn0, rn0, sn0, AlCaHLTBitMon_QueryRunRegistry::string, trackerContainers, and verbosity.

62  : conf_(conf), stripDigitizer_(new FP420DigiMain(conf)) {
63  std::string alias(conf.getParameter<std::string>("@module_label"));
64 
65  // produces<edm::DetSetVector<HDigiFP420> >().setBranchAlias( alias );
66  // produces<edm::DetSetVector<HDigiFP420SimLink> >().setBranchAlias ( alias +
67  // "hDigiFP420SimLink");
68  produces<DigiCollectionFP420>().setBranchAlias(alias);
69 
70  trackerContainers.clear();
71  trackerContainers = conf.getParameter<std::vector<std::string>>("ROUList");
72 
73  verbosity = conf_.getUntrackedParameter<int>("VerbosityLevel");
74  dn0 = conf_.getParameter<int>("NumberFP420Detectors");
75  sn0 = conf_.getParameter<int>("NumberFP420Stations");
76  pn0 = conf_.getParameter<int>("NumberFP420SPlanes");
77  rn0 = 7;
78  // rn0 = 3;
79 
80  // produces<DigiCollectionFP420>();
81 
82  // produces<StripDigiCollection>();
83  // produces<HDigiFP420>();
84  // produces<edm::DetSetVector<HDigiFP420> >().setBranchAlias( alias );
85 
86  // produces<DigiCollectionFP420>();
87  // produces<DigiCollectionFP420>("HDigiFP420");
88 
89  // produces<edm::DigiCollectionFP420>();
90 
91  // produces<edm::DetSetVector<DigiCollectionFP420> >();
92 
93  if (verbosity > 0) {
94  std::cout << "Creating a DigitizerFP420" << std::endl;
95  std::cout << "DigitizerFP420: dn0=" << dn0 << " sn0=" << sn0 << " pn0=" << pn0 << " rn0=" << rn0 << std::endl;
96  std::cout << "DigitizerFP420:trackerContainers.size()=" << trackerContainers.size() << std::endl;
97  }
98  }
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
FP420DigiMain * stripDigitizer_
edm::ParameterSet conf_
T getUntrackedParameter(std::string const &, T const &) const

◆ ~DigitizerFP420()

cms::DigitizerFP420::~DigitizerFP420 ( )
override

Definition at line 101 of file DigitizerFP420.cc.

References gather_cfg::cout, stripDigitizer_, and verbosity.

101  {
102  if (verbosity > 0) {
103  std::cout << "Destroying a DigitizerFP420" << std::endl;
104  }
105  delete stripDigitizer_;
106  }
FP420DigiMain * stripDigitizer_

Member Function Documentation

◆ produce()

void cms::DigitizerFP420::produce ( edm::Event e,
const edm::EventSetup c 
)
overridevirtual

Implements edm::one::EDProducerBase.

Definition at line 109 of file DigitizerFP420.cc.

References HDigiFP420::adc(), HDigiFP420::channel(), collector, gather_cfg::cout, PSimHit::detUnitId(), dn0, first, mps_fire::i, iEvent, pileupCalc::inputRange, phase1PixelTopology::layer, eostools::move(), hgcalPerformanceValidation::orient, convertSQLitetoXML_cfg::output, FP420NumberingScheme::packFP420Index(), FP420NumberingScheme::packMYIndex(), pn0, edm::Handle< T >::product(), rn0, FP420DigiMain::run(), SimHitMap, sn0, HDigiFP420::strip(), stripDigitizer_, HDigiFP420::stripV(), HDigiFP420::stripVW(), trackerContainers, FP420NumberingScheme::unpackFP420Index(), FP420NumberingScheme::unpackLayerIndex(), FP420NumberingScheme::unpackMYIndex(), FP420NumberingScheme::unpackOrientation(), verbosity, and ecaldqm::zside().

109  {
110  // be lazy and include the appropriate namespaces
111  using namespace edm;
112  using namespace std;
113 
114  if (verbosity > 0) {
115  std::cout << " ===" << std::endl;
116  std::cout << " ============== DigitizerFP420: start produce= " << std::endl;
117  std::cout << " ===" << std::endl;
118  }
119  // Get input
120  // std::cout << "DigitizerFP420 start produce" << std::endl;
121  // edm::ESHandle < ParticleDataTable > pdt;
122  // iSetup.getData( pdt );
123 
124  // Step A: Get Inputs for allTrackerHits
125 
127  std::vector<const CrossingFrame<PSimHit> *> cf_simhitvec;
128  for (uint32_t i = 0; i < trackerContainers.size(); i++) {
129  iEvent.getByLabel("mix", trackerContainers[i], cf_simhit);
130  cf_simhitvec.push_back(cf_simhit.product());
131  }
132  std::unique_ptr<MixCollection<PSimHit>> allTrackerHits(new MixCollection<PSimHit>(cf_simhitvec));
133 
134  // use instead of the previous
135  /*
136  std::cout <<" ============== DigitizerFP420: start loop 1 "
137  << std::endl; edm::Handle<CrossingFrame<PSimHit> > xFrame; std::cout <<"
138  ============== DigitizerFP420: start loop 2 " << std::endl;
139  iEvent.getByLabel("mix","FP420SI",xFrame);
140  std::cout <<" ============== DigitizerFP420: start loop 3 "
141  << std::endl; std::unique_ptr<MixCollection<PSimHit> > allTrackerHits( new
142  MixCollection<PSimHit>(xFrame.product()) ); std::cout <<" ==============
143  DigitizerFP420: start loop 4 " << std::endl;
144  */
145 
146  // Loop on PSimHit
147 
149  // Step C: create empty output collection
150  std::unique_ptr<DigiCollectionFP420> output(new DigiCollectionFP420);
151  // std::unique_ptr<edm::DetSetVector<HDigiFP420> > outputfinal(new
152  // edm::DetSetVector<HDigiFP420>(output) );
153  // std::unique_ptr<edm::DetSetVector<HDigiFP420> > outputfinal(new
154  // edm::DetSetVector<HDigiFP420>(output) );
155  // std::unique_ptr<edm::DetSetVector<HDigiFP420SimLink> > outputlink(new
156  // edm::DetSetVector<HDigiFP420SimLink>(output) );
157 
158  SimHitMap.clear();
159 
160  // ==================================
161  if (verbosity > 0) {
162  std::cout << " ===" << std::endl;
163  std::cout << " ============== DigitizerFP420: MixCollection treatment= " << std::endl;
164  std::cout << " ===" << std::endl;
165  }
166 
168  for (isim = allTrackerHits->begin(); isim != allTrackerHits->end(); isim++) {
169  unsigned int unitID = (*isim).detUnitId();
170  int det, zside, sector, zmodule;
171  FP420NumberingScheme::unpackFP420Index(unitID, det, zside, sector, zmodule);
172  // below, the continues plane index should be (for even different sensor
173  // index zside)
174  // unsigned int intindex = packMYIndex(rn0, pn0, sn0, det, zside, sector,
175  // zmodule);
176  unsigned int intindex = FP420NumberingScheme::packMYIndex(rn0, pn0, sn0, det, zside, sector, zmodule);
177  // int zScale=(rn0-1), sScale = (rn0-1)*(pn0-1), dScale =
178  //(rn0-1)*(pn0-1)*(sn0-1); unsigned int intindex = dScale*(det -
179  // 1)+sScale*(sector - 1)+zScale*(zmodule - 1)+zside;
180 
181  if (verbosity > 0) {
182  double losenergy = (*isim).energyLoss();
183  std::cout << " ===" << std::endl;
184  std::cout << " ============== DigitizerFP420: losenergy= " << losenergy << std::endl;
185  std::cout << " === for intindex = " << intindex << std::endl;
186  }
187  // does not matter which index is used: intindex or unitID - mainly to
188  // collect hits under every index
189  SimHitMap[intindex].push_back((*isim));
190  // for development later one( cal be used another index):
191  // SimHitMap[unitID].push_back((*isim));
192  }
193  //============================================================================================================================
194 
195  if (verbosity > 0) {
196  std::cout << " ===" << std::endl;
197  std::cout << " ============== DigitizerFP420: put zero to container " << std::endl;
198  std::cout << " ===" << std::endl;
199  }
200  // put zero to container info from the beginning (important! because not
201  // any detID is updated with coming of new event !!!!!!
202  // clean info of container from previous event
203  for (int det = 1; det < dn0; det++) {
204  for (int sector = 1; sector < sn0; sector++) {
205  for (int zmodule = 1; zmodule < pn0; zmodule++) {
206  for (int zside = 1; zside < rn0; zside++) {
207  // intindex is a continues numbering of FP420
208  unsigned int detID = FP420NumberingScheme::packMYIndex(rn0, pn0, sn0, det, zside, sector, zmodule);
209  // int zScale=(rn0-1), sScale = (rn0-1)*(pn0-1), dScale =
210  // (rn0-1)*(pn0-1)*(sn0-1); unsigned int detID = dScale*(det -
211  // 1)+sScale*(sector - 1)+zScale*(zmodule - 1)+zside;
212  std::vector<HDigiFP420> collector;
213  collector.clear();
215  inputRange.first = collector.begin();
216  inputRange.second = collector.end();
217  output->putclear(inputRange, detID);
218  } // for
219  } // for
220  } // for
221  } // for
222  // !!!!!!
223  // if we want to keep Digi container/Collection for one event uncomment the
224  // line below and vice versa
225  output->clear(); // container_.clear() --> start from the beginning of the
226  // container
227 
228  //============================================================================================================================================
229 
230  if (verbosity > 0) {
231  std::cout << " ===" << std::endl;
232  std::cout << " ============== DigitizerFP420: start loop over det iu " << std::endl;
233  std::cout << " ============== DigitizerFP420: SimHitMap.size()= " << SimHitMap.size() << std::endl;
234  std::cout << " ===" << std::endl;
235  }
236  bool first = true;
237 
239  /*
240  if(verbosity>0) std::cout <<"======= DigitizerFP420: SimHitMap size = " <<
241  SimHitMap.size() << std::endl; for(unsigned int i = 0; i < SimHitMap.size();
242  i++ ) {
243  // std::cout <<" ====== DigitizerFP420: i= " << i << std::endl;
244  vector<PSimHit>::const_iterator simHitIter = SimHitMap[i].begin();
245  vector<PSimHit>::const_iterator simHitIterEnd = SimHitMap[i].end();
246  for (;simHitIter != simHitIterEnd; ++simHitIter) {
247  const PSimHit ihit = *simHitIter;
248  unsigned int unitID = ihit.detUnitId();
249  if(verbosity>0) std::cout <<" ====== DigitizerFP420: unitID= " << unitID
250  << " i= " << i << std::endl; int det, zside, sector, zmodule;
251  FP420NumberingScheme::unpackFP420Index(unitID, det, zside, sector,
252  zmodule); int zScale=(rn0-1), sScale = (rn0-1)*(pn0-1), dScale =
253  (rn0-1)*(pn0-1)*(sn0-1); unsigned int iu = dScale*(det - 1)+sScale*(sector -
254  1)+zScale*(zmodule - 1)+zside;
255  }
256  }
257 */
259  //============================================================================================================================================
260  // new: <------
261  for (unsigned int i = 0; i < SimHitMap.size(); i++) {
262  vector<PSimHit>::const_iterator simHitIter = SimHitMap[i].begin();
263  vector<PSimHit>::const_iterator simHitIterEnd = SimHitMap[i].end();
264  for (; simHitIter != simHitIterEnd; ++simHitIter) {
265  const PSimHit ihit = *simHitIter;
266  unsigned int unitID = ihit.detUnitId();
267  if (verbosity > 0 || verbosity == -50)
268  std::cout << " ====== DigitizerFP420: unitID= " << unitID << "Hit number i= " << i << std::endl;
269  int det, zside, sector, zmodule;
270  FP420NumberingScheme::unpackFP420Index(unitID, det, zside, sector, zmodule);
271 
272  unsigned int iu = FP420NumberingScheme::packMYIndex(rn0, pn0, sn0, det, zside, sector, zmodule);
273  if (verbosity > 0 || verbosity == -50)
274  std::cout << "for Hits iu = " << iu << " sector = " << sector << " zmodule = " << zmodule
275  << " zside = " << zside << " det=" << det << std::endl;
276  // int zScale=(rn0-1), sScale = (rn0-1)*(pn0-1), dScale =
277  // (rn0-1)*(pn0-1)*(sn0-1);
278  // unsigned int iu = dScale*(det - 1)+sScale*(sector - 1)+zScale*(zmodule
279  // - 1)+zside;
280 
281  if (verbosity > 0) {
282  unsigned int index = FP420NumberingScheme::packFP420Index(det, zside, sector, zmodule);
283  std::cout << " DigitizerFP420: index = " << index << " iu = " << iu << std::endl;
284  }
285 
286  // GlobalVector bfield=pSetup->inTesla((*iu)->surface().position());
287  // CLHEP::Hep3Vector Bfieldloc=bfield();
288  G4ThreeVector bfield(0., 0., 0.0);
289  // G4ThreeVector bfield( 0.5, 0.5, 1.0 );
290 
291  if (verbosity > 0) {
292  std::cout << " ===" << std::endl;
293  std::cout << " ============== DigitizerFP420: call run for iu= " << iu << std::endl;
294  std::cout << " ===" << std::endl;
295  }
296  collector.clear();
297 
298  collector = stripDigitizer_->run(SimHitMap[iu], bfield,
299  iu); // stripDigitizer_.run... return
300  // ,sScale
301 
302  if (verbosity > 0) {
303  std::cout << " ===" << std::endl;
304  std::cout << " ===" << std::endl;
305  std::cout << "======= DigitizerFP420: collector size = " << collector.size() << std::endl;
306  std::cout << " ===" << std::endl;
307  std::cout << " ===" << std::endl;
308  }
309  /*
310 
311  std::vector<HDigiFP420> collector;
312  collector.clear();
313  DigiCollectionFP420::Range inputRange;
314  inputRange.first = collector.begin();
315  inputRange.second = collector.end();
316  output->putclear(inputRange,detID);
317  */
318  if (!collector.empty()) {
319  if (verbosity > 0) {
320  std::cout << " ============= DigitizerFP420:collector "
321  "start!!!!!!!!!!!!!!"
322  << std::endl;
323  }
324  DigiCollectionFP420::Range outputRange;
325  outputRange.first = collector.begin();
326  outputRange.second = collector.end();
327 
328  if (first) {
329  // use it only if ClusterCollectionFP420 is the ClusterCollection of
330  // one event, otherwise, do not use (loose 1st cl. of 1st event only)
331  first = false;
332  unsigned int detID0 = 0;
333  output->put(outputRange, detID0); // !!! put into adress 0 for detID
334  // which will not be used never
335  } // if ( first )
336 
337  // put !!!
338  output->put(outputRange, iu);
339 
340  } // if(collector.size()>0
341 
342  // } // for
343  // } // for
344  // } // for
345  // } // for
346 
347  } // for
348  } // for
349 
350  // END
351 
352  /*
353  if(verbosity>0) {
354  std::vector<HDigiFP420> theAllDigis;
355  theAllDigis.clear();
356  DigiCollectionFP420::Range outputRange;
357  DigiCollectionFP420::ContainerIterator sort_begin = outputRange.first;
358  DigiCollectionFP420::ContainerIterator sort_end = outputRange.second;
359  theAllDigis.insert(theAllDigis.end(), sort_begin, sort_end);
360  std::cout <<"====== theAllDigis size = " << theAllDigis.size() <<
361  std::endl; for (std::vector<HDigiFP420>::iterator isim = theAllDigis.begin();
362  isim != theAllDigis.end(); ++isim){
363  const HDigiFP420 istrip = *isim;
364  std::cout <<
365  "*******************************************DigitizerFP420:check1" <<
366  std::endl; std::cout << " strip number=" << istrip.strip() << " adc=" <<
367  istrip.adc() << std::endl; std::cout <<" channel =" << istrip.channel() <<" V
368  " << istrip.stripV() <<" VW " << istrip.stripVW() << std::endl; std::cout <<"
369  ===" << std::endl; std::cout <<" ===" << std::endl; std::cout <<"
370  =======================" << std::endl;
371  }// for
372  }
373 */
374  if (verbosity == -50) {
375  // check of access to the collector:
376  for (int det = 1; det < dn0; det++) {
377  for (int sector = 1; sector < sn0; sector++) {
378  for (int zmodule = 1; zmodule < pn0; zmodule++) {
379  for (int zside = 1; zside < rn0; zside++) {
380  unsigned int iu = FP420NumberingScheme::packMYIndex(rn0, pn0, sn0, det, zside, sector, zmodule);
383  std::cout << "****DigitizerFP420:check2" << std::endl;
384  // std::cout <<" iu = " << iu <<" sector = " << sector <<" zmodule
385  //= " << zmodule <<" zside = " << zside << " det=" << det <<
386  // std::endl; std::cout <<" layer = " << layer <<" orient = "
387  // << orient << std::endl;
388  int newdet, newzside, newsector, newzmodule;
389  FP420NumberingScheme::unpackMYIndex(iu, rn0, pn0, sn0, newdet, newzside, newsector, newzmodule);
390  std::cout << " newdet = " << newdet << " newsector = " << newsector << " newzmodule = " << newzmodule
391  << " newzside = " << newzside << std::endl;
392 
393  collector.clear();
394  DigiCollectionFP420::Range outputRange;
395  // outputRange = output->get(iu);
396  outputRange = output->get(iu);
397 
398  // fill output in collector vector (for may be sorting? or other
399  // checks)
400  std::vector<HDigiFP420> collector;
401  // collector.clear();
402  DigiCollectionFP420::ContainerIterator sort_begin = outputRange.first;
403  DigiCollectionFP420::ContainerIterator sort_end = outputRange.second;
404  for (; sort_begin != sort_end; ++sort_begin) {
405  collector.push_back(*sort_begin);
406  } // for
407  // std::sort(collector.begin(),collector.end());
408  std::cout << " ===" << std::endl;
409  std::cout << "====== collector size = " << collector.size() << std::endl;
410  if (!collector.empty()) {
411  std::cout << " iu = " << iu << " sector = " << sector << " zmodule = " << zmodule
412  << " zside = " << zside << " det=" << det << " layer = " << layer << " orient = " << orient
413  << std::endl;
414  std::cout << " ===" << std::endl;
415  }
416  vector<HDigiFP420>::const_iterator simHitIter = collector.begin();
417  vector<HDigiFP420>::const_iterator simHitIterEnd = collector.end();
418  for (; simHitIter != simHitIterEnd; ++simHitIter) {
419  const HDigiFP420 istrip = *simHitIter;
420  std::cout << " strip number=" << istrip.strip() << " adc=" << istrip.adc() << std::endl;
421  std::cout << " channel =" << istrip.channel() << " V " << istrip.stripV() << " VW " << istrip.stripVW()
422  << std::endl;
423  std::cout << " ===" << std::endl;
424  std::cout << " ===" << std::endl;
425  std::cout << " ===================================================" << std::endl;
426  }
427 
428  //==================================
429 
430  } // for
431  } // for
432  } // for
433  } // for
434 
435  // end of check of access to the strip collection
436 
437  } // if(verbosity
438 
439  // Step D: write output to file
440  if (verbosity > 0) {
441  std::cout << "DigitizerFP420 recoutput" << std::endl;
442  }
443  // Step D: write output to file
444  iEvent.put(std::move(output));
445  } // produce
unsigned int detUnitId() const
Definition: PSimHit.h:97
FP420DigiMain * stripDigitizer_
int stripVW() const
Definition: HDigiFP420.h:21
std::vector< HDigiFP420 >::const_iterator ContainerIterator
T const * product() const
Definition: Handle.h:70
static void unpackFP420Index(const unsigned int &idx, int &det, int &zside, int &station, int &superplane)
int zside(DetId const &)
static int unpackLayerIndex(int rn0, int zside)
std::vector< HDigiFP420 > collector
static void unpackMYIndex(const int &idx, int rn0, int pn0, int sn0, int &det, int &zside, int &sector, int &zmodule)
constexpr std::array< uint8_t, layerIndexSize > layer
std::vector< HDigiFP420 > run(const std::vector< PSimHit > &input, const G4ThreeVector &, unsigned int)
int iEvent
Definition: GenABIO.cc:224
int stripV() const
Definition: HDigiFP420.h:23
static unsigned packMYIndex(int rn0, int pn0, int sn0, int det, int zside, int sector, int zmodule)
int channel() const
Definition: HDigiFP420.h:19
static unsigned int packFP420Index(int det, int zside, int station, int superplane)
std::pair< ContainerIterator, ContainerIterator > Range
HLT enums.
int adc() const
Definition: HDigiFP420.h:18
static int unpackOrientation(int rn0, int zside)
int strip() const
Definition: HDigiFP420.h:17
def move(src, dest)
Definition: eostools.py:511

Member Data Documentation

◆ collector

std::vector<HDigiFP420> cms::DigitizerFP420::collector
private

Definition at line 53 of file DigitizerFP420.h.

Referenced by produce().

◆ conf_

edm::ParameterSet cms::DigitizerFP420::conf_
private

Definition at line 45 of file DigitizerFP420.h.

Referenced by DigitizerFP420().

◆ dn0

int cms::DigitizerFP420::dn0
private

Definition at line 51 of file DigitizerFP420.h.

Referenced by DigitizerFP420(), and produce().

◆ numStrips

int cms::DigitizerFP420::numStrips
private

Definition at line 49 of file DigitizerFP420.h.

◆ pn0

int cms::DigitizerFP420::pn0
private

Definition at line 51 of file DigitizerFP420.h.

Referenced by DigitizerFP420(), and produce().

◆ rn0

int cms::DigitizerFP420::rn0
private

Definition at line 51 of file DigitizerFP420.h.

Referenced by DigitizerFP420(), and produce().

◆ SimHitMap

simhit_map cms::DigitizerFP420::SimHitMap
private

Definition at line 43 of file DigitizerFP420.h.

Referenced by produce().

◆ sn0

int cms::DigitizerFP420::sn0
private

Definition at line 51 of file DigitizerFP420.h.

Referenced by DigitizerFP420(), and produce().

◆ stripDigitizer_

FP420DigiMain* cms::DigitizerFP420::stripDigitizer_
private

Definition at line 48 of file DigitizerFP420.h.

Referenced by produce(), and ~DigitizerFP420().

◆ trackerContainers

vstring cms::DigitizerFP420::trackerContainers
private

Definition at line 46 of file DigitizerFP420.h.

Referenced by DigitizerFP420(), and produce().

◆ verbosity

int cms::DigitizerFP420::verbosity
private

Definition at line 51 of file DigitizerFP420.h.

Referenced by DigitizerFP420(), produce(), and ~DigitizerFP420().