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::EDProducer edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Member Functions

void beginJob () override
 
 ClusterizerFP420 (const edm::ParameterSet &conf)
 
void produce (edm::Event &e, const edm::EventSetup &c) override
 
 ~ClusterizerFP420 () override
 
- Public Member Functions inherited from edm::EDProducer
 EDProducer ()
 
SerialTaskQueueglobalLuminosityBlocksQueue ()
 
SerialTaskQueueglobalRunsQueue ()
 
ModuleDescription const & moduleDescription () const
 
 ~EDProducer () 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 &&)=default
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
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::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
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 Types

typedef std::vector< std::string > vstring
 

Private Attributes

edm::ParameterSet conf_
 
int dn0
 
std::vector< ClusterNoiseFP420noise
 
int pn0
 
int rn0
 
FP420ClusterMainsClusterizerFP420_
 
int sn0
 
ClusterCollectionFP420soutput
 
vstring trackerContainers
 
bool UseNoiseBadElectrodeFlagFromDB_
 
int verbosity
 

Additional Inherited Members

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

Detailed Description

Definition at line 29 of file ClusterizerFP420.h.

Member Typedef Documentation

◆ vstring

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

Definition at line 43 of file ClusterizerFP420.h.

Constructor & Destructor Documentation

◆ ClusterizerFP420()

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

Definition at line 41 of file ClusterizerFP420.cc.

41  : conf_(conf) {
42  std::string alias(conf.getParameter<std::string>("@module_label"));
43 
44  produces<ClusterCollectionFP420>().setBranchAlias(alias);
45 
46  trackerContainers.clear();
47  trackerContainers = conf.getParameter<std::vector<std::string> >("ROUList");
48 
49  verbosity = conf_.getUntrackedParameter<int>("VerbosityLevel");
50  dn0 = conf_.getParameter<int>("NumberFP420Detectors");
51  sn0 = conf_.getParameter<int>("NumberFP420Stations");
52  pn0 = conf_.getParameter<int>("NumberFP420SPlanes");
53  rn0 = 7;
54  if (verbosity > 0) {
55  std::cout << "Creating a ClusterizerFP420" << std::endl;
56  std::cout << "ClusterizerFP420: dn0=" << dn0 << " sn0=" << sn0 << " pn0=" << pn0 << " rn0=" << rn0 << std::endl;
57  }
58 
60  }

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

◆ ~ClusterizerFP420()

cms::ClusterizerFP420::~ClusterizerFP420 ( )
override

Definition at line 63 of file ClusterizerFP420.cc.

63 { delete sClusterizerFP420_; }

References sClusterizerFP420_.

Member Function Documentation

◆ beginJob()

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

Reimplemented from edm::EDProducer.

Definition at line 66 of file ClusterizerFP420.cc.

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

References gather_cfg::cout, and verbosity.

◆ produce()

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

Implements edm::EDProducer.

Definition at line 99 of file ClusterizerFP420.cc.

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

References ClusterCollectionFP420::clear(), gather_cfg::cout, dn0, Exception, ClusterCollectionFP420::get(), iEvent, input, pileupCalc::inputRange, eostools::move(), noise, FP420NumberingScheme::packMYIndex(), pn0, ClusterCollectionFP420::putclear(), rn0, FP420ClusterMain::run(), sClusterizerFP420_, sn0, soutput, trackerContainers, verbosity, and ecaldqm::zside().

Member Data Documentation

◆ conf_

edm::ParameterSet cms::ClusterizerFP420::conf_
private

Definition at line 45 of file ClusterizerFP420.h.

Referenced by ClusterizerFP420().

◆ dn0

int cms::ClusterizerFP420::dn0
private

Definition at line 54 of file ClusterizerFP420.h.

Referenced by ClusterizerFP420(), and produce().

◆ noise

std::vector<ClusterNoiseFP420> cms::ClusterizerFP420::noise
private

Definition at line 52 of file ClusterizerFP420.h.

Referenced by produce().

◆ pn0

int cms::ClusterizerFP420::pn0
private

Definition at line 54 of file ClusterizerFP420.h.

Referenced by ClusterizerFP420(), and produce().

◆ rn0

int cms::ClusterizerFP420::rn0
private

Definition at line 54 of file ClusterizerFP420.h.

Referenced by ClusterizerFP420(), and produce().

◆ sClusterizerFP420_

FP420ClusterMain* cms::ClusterizerFP420::sClusterizerFP420_
private

Definition at line 48 of file ClusterizerFP420.h.

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

◆ sn0

int cms::ClusterizerFP420::sn0
private

Definition at line 54 of file ClusterizerFP420.h.

Referenced by ClusterizerFP420(), and produce().

◆ soutput

ClusterCollectionFP420* cms::ClusterizerFP420::soutput
private

Definition at line 50 of file ClusterizerFP420.h.

Referenced by produce().

◆ trackerContainers

vstring cms::ClusterizerFP420::trackerContainers
private

Definition at line 46 of file ClusterizerFP420.h.

Referenced by ClusterizerFP420(), and produce().

◆ UseNoiseBadElectrodeFlagFromDB_

bool cms::ClusterizerFP420::UseNoiseBadElectrodeFlagFromDB_
private

Definition at line 53 of file ClusterizerFP420.h.

◆ verbosity

int cms::ClusterizerFP420::verbosity
private

Definition at line 55 of file ClusterizerFP420.h.

Referenced by beginJob(), ClusterizerFP420(), and produce().

input
static const std::string input
Definition: EdmProvDump.cc:48
FP420ClusterMain
Definition: FP420ClusterMain.h:25
ecaldqm::zside
int zside(DetId const &)
Definition: EcalDQMCommonUtils.cc:189
edm
HLT enums.
Definition: AlignableModifier.h:19
gather_cfg.cout
cout
Definition: gather_cfg.py:144
cms::ClusterizerFP420::conf_
edm::ParameterSet conf_
Definition: ClusterizerFP420.h:45
cms::ClusterizerFP420::verbosity
int verbosity
Definition: ClusterizerFP420.h:55
edm::ParameterSet::getUntrackedParameter
T getUntrackedParameter(std::string const &, T const &) const
edm::Handle
Definition: AssociativeIterator.h:50
edm::Exception
Definition: EDMException.h:77
pileupCalc.inputRange
inputRange
Definition: pileupCalc.py:218
ClusterCollectionFP420::clear
void clear()
Definition: ClusterCollectionFP420.cc:97
FP420ClusterMain::run
void run(edm::Handle< DigiCollectionFP420 > &input, ClusterCollectionFP420 *soutput, std::vector< ClusterNoiseFP420 > &noise)
Runs the algorithm.
Definition: FP420ClusterMain.cc:112
cms::ClusterizerFP420::sn0
int sn0
Definition: ClusterizerFP420.h:54
cms::ClusterizerFP420::dn0
int dn0
Definition: ClusterizerFP420.h:54
cms::ClusterizerFP420::pn0
int pn0
Definition: ClusterizerFP420.h:54
cms::ClusterizerFP420::rn0
int rn0
Definition: ClusterizerFP420.h:54
FP420NumberingScheme::packMYIndex
static unsigned packMYIndex(int rn0, int pn0, int sn0, int det, int zside, int sector, int zmodule)
Definition: FP420NumberingScheme.h:37
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
cms::ClusterizerFP420::sClusterizerFP420_
FP420ClusterMain * sClusterizerFP420_
Definition: ClusterizerFP420.h:48
iEvent
int iEvent
Definition: GenABIO.cc:224
cms::ClusterizerFP420::soutput
ClusterCollectionFP420 * soutput
Definition: ClusterizerFP420.h:50
eostools.move
def move(src, dest)
Definition: eostools.py:511
std
Definition: JetResolutionObject.h:76
ClusterCollectionFP420::putclear
void putclear(Range input, unsigned int detID)
Definition: ClusterCollectionFP420.cc:98
SiStripOfflineCRack_cfg.alias
alias
Definition: SiStripOfflineCRack_cfg.py:128
Exception
Definition: hltDiff.cc:246
ClusterCollectionFP420::get
const Range get(unsigned int detID) const
Definition: ClusterCollectionFP420.cc:69
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
cms::ClusterizerFP420::noise
std::vector< ClusterNoiseFP420 > noise
Definition: ClusterizerFP420.h:52
ClusterCollectionFP420::Range
std::pair< ContainerIterator, ContainerIterator > Range
Definition: ClusterCollectionFP420.h:12
cms::ClusterizerFP420::trackerContainers
vstring trackerContainers
Definition: ClusterizerFP420.h:46