CMS 3D CMS Logo

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

#include <ClusterizerFP420.h>

Inheritance diagram for cms::ClusterizerFP420:
edm::global::EDProducer<> edm::global::EDProducerBase edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Member Functions

void beginJob () override
 
 ClusterizerFP420 (const edm::ParameterSet &conf)
 
void produce (edm::StreamID, edm::Event &e, const edm::EventSetup &c) const override
 
- Public Member Functions inherited from edm::global::EDProducer<>
 EDProducer ()=default
 
 EDProducer (const EDProducer &)=delete
 
bool hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginProcessBlocks () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndProcessBlocks () const final
 
bool hasAbilityToProduceInEndRuns () const final
 
EDProduceroperator= (const EDProducer &)=delete
 
bool wantsGlobalLuminosityBlocks () const final
 
bool wantsGlobalRuns () const final
 
bool wantsInputProcessBlocks () const final
 
bool wantsProcessBlocks () const final
 
bool wantsStreamLuminosityBlocks () const final
 
bool wantsStreamRuns () const final
 
- Public Member Functions inherited from edm::global::EDProducerBase
 EDProducerBase ()
 
ModuleDescription const & moduleDescription () 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::vector< std::string > vstring
 

Private Attributes

int dn0
 
int pn0
 
int rn0
 
std::unique_ptr< const FP420ClusterMainsClusterizerFP420_
 
int sn0
 
vstring trackerContainers
 
bool UseNoiseBadElectrodeFlagFromDB_
 
int verbosity
 

Additional Inherited Members

- Public Types inherited from edm::global::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::global::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 28 of file ClusterizerFP420.h.

Member Typedef Documentation

◆ vstring

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

Definition at line 37 of file ClusterizerFP420.h.

Constructor & Destructor Documentation

◆ ClusterizerFP420()

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

Definition at line 40 of file ClusterizerFP420.cc.

References SiStripOfflineCRack_cfg::alias, gather_cfg::cout, edm::ParameterSet::getParameter(), edm::ParameterSet::getUntrackedParameter(), AlCaHLTBitMon_QueryRunRegistry::string, and ctppsCommonDQMSource_cfi::verbosity.

40  {
41  std::string alias(conf.getParameter<std::string>("@module_label"));
42 
43  produces<ClusterCollectionFP420>().setBranchAlias(alias);
44 
45  trackerContainers.clear();
46  trackerContainers = conf.getParameter<std::vector<std::string> >("ROUList");
47 
48  verbosity = conf.getUntrackedParameter<int>("VerbosityLevel");
49  dn0 = conf.getParameter<int>("NumberFP420Detectors");
50  sn0 = conf.getParameter<int>("NumberFP420Stations");
51  pn0 = conf.getParameter<int>("NumberFP420SPlanes");
52  rn0 = 7;
53  if (verbosity > 0) {
54  std::cout << "Creating a ClusterizerFP420" << std::endl;
55  std::cout << "ClusterizerFP420: dn0=" << dn0 << " sn0=" << sn0 << " pn0=" << pn0 << " rn0=" << rn0 << std::endl;
56  }
57 
58  sClusterizerFP420_ = std::make_unique<FP420ClusterMain>(conf, dn0, sn0, pn0, rn0);
59  }
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
std::unique_ptr< const FP420ClusterMain > sClusterizerFP420_
T getUntrackedParameter(std::string const &, T const &) const

Member Function Documentation

◆ beginJob()

void cms::ClusterizerFP420::beginJob ( void  )
overridevirtual

Reimplemented from edm::global::EDProducerBase.

Definition at line 62 of file ClusterizerFP420.cc.

References gather_cfg::cout, and ctppsCommonDQMSource_cfi::verbosity.

62  {
63  if (verbosity > 0) {
64  std::cout << "BeginJob method " << std::endl;
65  }
66  //Getting Calibration data (Noises and BadElectrodes Flag)
67  // bool UseNoiseBadElectrodeFlagFromDB_=conf_.getParameter<bool>("UseNoiseBadElectrodeFlagFromDB");
68  // if (UseNoiseBadElectrodeFlagFromDB_==true){
69  // iSetup.get<ClusterNoiseFP420Rcd>().get(noise);// AZ: do corrections for noise here
70  //=========================================================
71  //
72  // Debug: show noise for DetIDs
73  // ElectrodNoiseMapIterator mapit = noise->m_noises.begin();
74  // for (;mapit!=noise->m_noises.end();mapit++)
75  // {
76  // unsigned int detid = (*mapit).first;
77  // std::cout << "detid " << detid << " # Electrode " << (*mapit).second.size()<<std::endl;
78  // //ElectrodNoiseVector theElectrodVector = (*mapit).second;
79  // const ElectrodNoiseVector theElectrodVector = noise->getElectrodNoiseVector(detid);
80 
81  // int electrode=0;
82  // ElectrodNoiseVectorIterator iter=theElectrodVector.begin();
83  // //for(; iter!=theElectrodVector.end(); iter++)
84  // {
85  // std::cout << " electrode " << electrode++ << " =\t"
86  // << iter->getNoise() << " \t"
87  // << iter->getDisable() << " \t"
88  // << std::endl;
89  // }
90  // }
91  //===========================================================
92  // }
93  }

◆ produce()

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

Implements edm::global::EDProducerBase.

Definition at line 95 of file ClusterizerFP420.cc.

References gather_cfg::cout, Exception, iEvent, input, pileupCalc::inputRange, eostools::move(), FP420NumberingScheme::packMYIndex(), ctppsCommonDQMSource_cfi::verbosity, and ecaldqm::zside().

95  {
96  // beginJob;
97  // be lazy and include the appropriate namespaces
98  using namespace edm;
99  using namespace std;
100  if (verbosity > 0) {
101  std::cout << "ClusterizerFP420: produce" << std::endl;
102  }
103 
104  // Get input
105  //A
106  // edm::Handle<DigiCollectionFP420> icf_simhit;
107  /*
108  Handle<DigiCollectionFP420> cf_simhit;
109  std::vector<const DigiCollectionFP420 *> cf_simhitvec;
110  for(uint32_t i = 0; i< trackerContainers.size();i++){
111  iEvent.getByLabel( trackerContainers[i], cf_simhit);
112  cf_simhitvec.push_back(cf_simhit.product()); }
113  std::unique_ptr<DigiCollectionFP420 > digis(new DigiCollectionFP420(cf_simhitvec));
114 
115  std::vector<HDigiFP420> input;
116  DigiCollectionFP420::iterator isim;
117  for (isim=digis->begin(); isim!= digis->end();isim++) {
118  input.push_back(*isim);
119  }
120 */
121  //B
122 
124  try {
125  // iEvent.getByLabel( "FP420Digi" , digis);
126  iEvent.getByLabel(trackerContainers[0], input);
127  } catch (const Exception&) {
128  // in principal, should never happen, as it's taken care of by Framework
129  throw cms::Exception("InvalidReference") << "Invalid reference to DigiCollectionFP420 \n";
130  }
131 
132  if (verbosity > 0) {
133  std::cout << "ClusterizerFP420: OK1" << std::endl;
134  }
135 
136  // Step C: create empty output collection
137  auto soutput = std::make_unique<ClusterCollectionFP420>();
139  /*
140  std::vector<SimVertex> input;
141  Handle<DigiCollectionFP420> digis;
142  iEvent.getByLabel("FP420Digi",digis);
143  input.insert(input.end(),digis->begin(),digis->end());
144 
145 
146 
147  std::vector<HDigiFP420> input;
148  for(std::vector<HDigiFP420>::const_iterator vsim=digis->begin();
149  vsim!=digis->end(); ++vsim){
150  input.push_back(*vsim);
151  }
152  theSimTracks.insert(theSimTracks.end(),SimTk->begin(),SimTk->end());
153 */
154  // std::vector<HDigiFP420> input;
155  // DigiCollectionFP420 input;
156  //input.push_back(digis);
157  // input.insert(input.end(), digis->begin(), digis->end());
158 
159  /*
160  std::vector<HDigiFP420> input;
161  input.clear();
162  DigiCollectionFP420::ContainerIterator sort_begin = digis->begin();
163  DigiCollectionFP420::ContainerIterator sort_end = digis->end();
164  for ( ;sort_begin != sort_end; ++sort_begin ) {
165  input.push_back(*sort_begin);
166  } // for
167 */
168 
169  // put zero to container info from the beginning (important! because not any detID is updated with coming of new event !!!!!!
170  // clean info of container from previous event
171  for (int det = 1; det < dn0; det++) {
172  for (int sector = 1; sector < sn0; sector++) {
173  for (int zmodule = 1; zmodule < pn0; zmodule++) {
174  for (int zside = 1; zside < rn0; zside++) {
175  // intindex is a continues numbering of FP420
176  unsigned int detID = FP420NumberingScheme::packMYIndex(rn0, pn0, sn0, det, zside, sector, zmodule);
177  std::vector<ClusterFP420> collector;
178  collector.clear();
180  inputRange.first = collector.begin();
181  inputRange.second = collector.end();
182 
183  soutput->putclear(inputRange, detID);
184 
185  } //for
186  } //for
187  } //for
188  } //for
189 
190  // !!!!!!
191  // if we want to keep Cluster container/Collection for one event ---> uncomment the line below and vice versa
192  soutput->clear(); //container_.clear() --> start from the beginning of the container
193 
194  // RUN now: !!!!!!
195  // sClusterizerFP420_.run(input, soutput, noise);
196  if (verbosity > 0) {
197  std::cout << "ClusterizerFP420: OK2" << std::endl;
198  }
199  sClusterizerFP420_->run(input, soutput.get());
200 
201  if (verbosity > 0) {
202  std::cout << "ClusterizerFP420: OK3" << std::endl;
203  }
204 
205  // if(collectorZS.data.size()>0){
206 
207  // std::cout <<"======= ClusterizerFP420: end of produce " << std::endl;
208 
209  // Step D: write output to file
210  iEvent.put(std::move(soutput));
211  if (verbosity > 0) {
212  std::cout << "ClusterizerFP420: OK4" << std::endl;
213  }
214  } //produce
std::unique_ptr< const FP420ClusterMain > sClusterizerFP420_
int zside(DetId const &)
static std::string const input
Definition: EdmProvDump.cc:47
int iEvent
Definition: GenABIO.cc:224
static unsigned packMYIndex(int rn0, int pn0, int sn0, int det, int zside, int sector, int zmodule)
HLT enums.
std::pair< ContainerIterator, ContainerIterator > Range
def move(src, dest)
Definition: eostools.py:511

Member Data Documentation

◆ dn0

int cms::ClusterizerFP420::dn0
private

Definition at line 44 of file ClusterizerFP420.h.

◆ pn0

int cms::ClusterizerFP420::pn0
private

Definition at line 44 of file ClusterizerFP420.h.

◆ rn0

int cms::ClusterizerFP420::rn0
private

Definition at line 44 of file ClusterizerFP420.h.

◆ sClusterizerFP420_

std::unique_ptr<const FP420ClusterMain> cms::ClusterizerFP420::sClusterizerFP420_
private

Definition at line 41 of file ClusterizerFP420.h.

◆ sn0

int cms::ClusterizerFP420::sn0
private

Definition at line 44 of file ClusterizerFP420.h.

◆ trackerContainers

vstring cms::ClusterizerFP420::trackerContainers
private

Definition at line 39 of file ClusterizerFP420.h.

◆ UseNoiseBadElectrodeFlagFromDB_

bool cms::ClusterizerFP420::UseNoiseBadElectrodeFlagFromDB_
private

Definition at line 43 of file ClusterizerFP420.h.

◆ verbosity

int cms::ClusterizerFP420::verbosity
private

Definition at line 45 of file ClusterizerFP420.h.