CMS 3D CMS Logo

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

#include <ShallowClustersProducer.h>

Inheritance diagram for ShallowClustersProducer:
edm::EDProducer edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Classes

struct  moduleVars
 
struct  NearDigis
 

Public Member Functions

 ShallowClustersProducer (const edm::ParameterSet &)
 
- 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
 
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 Member Functions

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

Private Attributes

std::string Prefix
 
SiStripClusterInfo siStripClusterInfo_
 
edm::InputTag theClustersLabel
 
edm::EDGetTokenT< edmNew::DetSetVector< SiStripCluster > > theClustersToken_
 
edm::EDGetTokenT< edm::DetSetVector< SiStripProcessedRawDigi > > theDigisToken_
 

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 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>
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)
 
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 17 of file ShallowClustersProducer.h.

Constructor & Destructor Documentation

◆ ShallowClustersProducer()

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

Definition at line 12 of file ShallowClustersProducer.cc.

14  produces<std::vector<unsigned>>(Prefix + "number");
15  produces<std::vector<unsigned>>(Prefix + "width");
16  produces<std::vector<float>>(Prefix + "variance");
17  produces<std::vector<float>>(Prefix + "barystrip");
18  produces<std::vector<float>>(Prefix + "middlestrip");
19  produces<std::vector<unsigned>>(Prefix + "charge");
20  produces<std::vector<float>>(Prefix + "noise");
21  produces<std::vector<float>>(Prefix + "ston");
22  produces<std::vector<unsigned>>(Prefix + "seedstrip");
23  produces<std::vector<unsigned>>(Prefix + "seedindex");
24  produces<std::vector<unsigned>>(Prefix + "seedcharge");
25  produces<std::vector<float>>(Prefix + "seednoise");
26  produces<std::vector<float>>(Prefix + "seedgain");
27  produces<std::vector<unsigned>>(Prefix + "qualityisbad");
28 
29  produces<std::vector<float>>(Prefix + "rawchargeC");
30  produces<std::vector<float>>(Prefix + "rawchargeL");
31  produces<std::vector<float>>(Prefix + "rawchargeR");
32  produces<std::vector<float>>(Prefix + "rawchargeLL");
33  produces<std::vector<float>>(Prefix + "rawchargeRR");
34  produces<std::vector<float>>(Prefix + "eta");
35  produces<std::vector<float>>(Prefix + "foldedeta");
36  produces<std::vector<float>>(Prefix + "etaX");
37  produces<std::vector<float>>(Prefix + "etaasymm");
38  produces<std::vector<float>>(Prefix + "outsideasymm");
39  produces<std::vector<float>>(Prefix + "neweta");
40  produces<std::vector<float>>(Prefix + "newetaerr");
41 
42  produces<std::vector<unsigned>>(Prefix + "detid");
43  produces<std::vector<int>>(Prefix + "subdetid");
44  produces<std::vector<int>>(Prefix + "module");
45  produces<std::vector<int>>(Prefix + "side");
46  produces<std::vector<int>>(Prefix + "layerwheel");
47  produces<std::vector<int>>(Prefix + "stringringrod");
48  produces<std::vector<int>>(Prefix + "petal");
49  produces<std::vector<int>>(Prefix + "stereo");
50 
51  theClustersToken_ = consumes<edmNew::DetSetVector<SiStripCluster>>(iConfig.getParameter<edm::InputTag>("Clusters"));
52  theDigisToken_ = consumes<edm::DetSetVector<SiStripProcessedRawDigi>>(edm::InputTag("siStripProcessedRawDigis", ""));
53 }

References edm::ParameterSet::getParameter(), HLT_2018_cff::InputTag, Prefix, theClustersToken_, and theDigisToken_.

Member Function Documentation

◆ produce()

void ShallowClustersProducer::produce ( edm::Event iEvent,
const edm::EventSetup iSetup 
)
overrideprivatevirtual

Implements edm::EDProducer.

Definition at line 55 of file ShallowClustersProducer.cc.

55  {
56  //Retrieve tracker topology from geometry
58  iSetup.get<TrackerTopologyRcd>().get(tTopoHandle);
59  const TrackerTopology* const tTopo = tTopoHandle.product();
60 
62 
63  auto number = std::make_unique<std::vector<unsigned>>(7, 0);
64  auto width = std::make_unique<std::vector<unsigned>>();
65  auto variance = std::make_unique<std::vector<float>>();
66  auto barystrip = std::make_unique<std::vector<float>>();
67  auto middlestrip = std::make_unique<std::vector<float>>();
68  auto charge = std::make_unique<std::vector<unsigned>>();
69  auto noise = std::make_unique<std::vector<float>>();
70  auto ston = std::make_unique<std::vector<float>>();
71  auto seedstrip = std::make_unique<std::vector<unsigned>>();
72  auto seedindex = std::make_unique<std::vector<unsigned>>();
73  auto seedcharge = std::make_unique<std::vector<unsigned>>();
74  auto seednoise = std::make_unique<std::vector<float>>();
75  auto seedgain = std::make_unique<std::vector<float>>();
76  auto qualityisbad = std::make_unique<std::vector<unsigned>>();
77 
78  auto rawchargeC = std::make_unique<std::vector<float>>();
79  auto rawchargeL = std::make_unique<std::vector<float>>();
80  auto rawchargeR = std::make_unique<std::vector<float>>();
81  auto rawchargeLL = std::make_unique<std::vector<float>>();
82  auto rawchargeRR = std::make_unique<std::vector<float>>();
83  auto etaX = std::make_unique<std::vector<float>>();
84  auto eta = std::make_unique<std::vector<float>>();
85  auto foldedeta = std::make_unique<std::vector<float>>();
86  auto etaasymm = std::make_unique<std::vector<float>>();
87  auto outsideasymm = std::make_unique<std::vector<float>>();
88  auto neweta = std::make_unique<std::vector<float>>();
89  auto newetaerr = std::make_unique<std::vector<float>>();
90 
91  auto detid = std::make_unique<std::vector<unsigned>>();
92  auto subdetid = std::make_unique<std::vector<int>>();
93  auto side = std::make_unique<std::vector<int>>();
94  auto module = std::make_unique<std::vector<int>>();
95  auto layerwheel = std::make_unique<std::vector<int>>();
96  auto stringringrod = std::make_unique<std::vector<int>>();
97  auto petal = std::make_unique<std::vector<int>>();
98  auto stereo = std::make_unique<std::vector<int>>();
99 
101  // iEvent.getByLabel(theClustersLabel, clusters);
102  iEvent.getByToken(theClustersToken_, clusters);
103 
105  // iEvent.getByLabel("siStripProcessedRawDigis", "", rawProcessedDigis);
106  iEvent.getByToken(theDigisToken_, rawProcessedDigis);
107 
109  for (; itClusters != clusters->end(); ++itClusters) {
110  uint32_t id = itClusters->id();
111  const moduleVars moduleV(id, tTopo);
112  for (edmNew::DetSet<SiStripCluster>::const_iterator cluster = itClusters->begin(); cluster != itClusters->end();
113  ++cluster) {
114  siStripClusterInfo_.setCluster(*cluster, id);
116  const NearDigis digis = rawProcessedDigis.isValid() ? NearDigis(info, *rawProcessedDigis) : NearDigis(info);
117 
118  (number->at(0))++;
119  (number->at(moduleV.subdetid))++;
120  width->push_back(cluster->amplitudes().size());
121  barystrip->push_back(cluster->barycenter());
122  variance->push_back(info.variance());
123  middlestrip->push_back(info.firstStrip() + info.width() / 2.0);
124  charge->push_back(info.charge());
125  noise->push_back(info.noiseRescaledByGain());
126  ston->push_back(info.signalOverNoise());
127  seedstrip->push_back(info.maxStrip());
128  seedindex->push_back(info.maxIndex());
129  seedcharge->push_back(info.maxCharge());
130  seednoise->push_back(info.stripNoisesRescaledByGain().at(info.maxIndex()));
131  seedgain->push_back(info.stripGains().at(info.maxIndex()));
132  qualityisbad->push_back(info.IsAnythingBad());
133 
134  rawchargeC->push_back(digis.max);
135  rawchargeL->push_back(digis.left);
136  rawchargeR->push_back(digis.right);
137  rawchargeLL->push_back(digis.Lleft);
138  rawchargeRR->push_back(digis.Rright);
139  etaX->push_back(digis.etaX());
140  eta->push_back(digis.eta());
141  etaasymm->push_back(digis.etaasymm());
142  outsideasymm->push_back(digis.outsideasymm());
143  neweta->push_back((digis.last - digis.first) / info.charge());
144  newetaerr->push_back((sqrt(digis.last + digis.first)) / pow(info.charge(), 1.5));
145 
146  detid->push_back(id);
147  subdetid->push_back(moduleV.subdetid);
148  side->push_back(moduleV.side);
149  module->push_back(moduleV.module);
150  layerwheel->push_back(moduleV.layerwheel);
151  stringringrod->push_back(moduleV.stringringrod);
152  petal->push_back(moduleV.petal);
153  stereo->push_back(moduleV.stereo);
154  }
155  }
156 
157  iEvent.put(std::move(number), Prefix + "number");
158  iEvent.put(std::move(width), Prefix + "width");
159  iEvent.put(std::move(variance), Prefix + "variance");
160  iEvent.put(std::move(barystrip), Prefix + "barystrip");
161  iEvent.put(std::move(middlestrip), Prefix + "middlestrip");
162  iEvent.put(std::move(charge), Prefix + "charge");
163  iEvent.put(std::move(noise), Prefix + "noise");
164  iEvent.put(std::move(ston), Prefix + "ston");
165  iEvent.put(std::move(seedstrip), Prefix + "seedstrip");
166  iEvent.put(std::move(seedindex), Prefix + "seedindex");
167  iEvent.put(std::move(seedcharge), Prefix + "seedcharge");
168  iEvent.put(std::move(seednoise), Prefix + "seednoise");
169  iEvent.put(std::move(seedgain), Prefix + "seedgain");
170  iEvent.put(std::move(qualityisbad), Prefix + "qualityisbad");
171 
172  iEvent.put(std::move(rawchargeC), Prefix + "rawchargeC");
173  iEvent.put(std::move(rawchargeL), Prefix + "rawchargeL");
174  iEvent.put(std::move(rawchargeR), Prefix + "rawchargeR");
175  iEvent.put(std::move(rawchargeLL), Prefix + "rawchargeLL");
176  iEvent.put(std::move(rawchargeRR), Prefix + "rawchargeRR");
177  iEvent.put(std::move(etaX), Prefix + "etaX");
178  iEvent.put(std::move(eta), Prefix + "eta");
179  iEvent.put(std::move(foldedeta), Prefix + "foldedeta");
180  iEvent.put(std::move(etaasymm), Prefix + "etaasymm");
181  iEvent.put(std::move(outsideasymm), Prefix + "outsideasymm");
182  iEvent.put(std::move(neweta), Prefix + "neweta");
183  iEvent.put(std::move(newetaerr), Prefix + "newetaerr");
184 
185  iEvent.put(std::move(detid), Prefix + "detid");
186  iEvent.put(std::move(subdetid), Prefix + "subdetid");
187  iEvent.put(std::move(module), Prefix + "module");
188  iEvent.put(std::move(side), Prefix + "side");
189  iEvent.put(std::move(layerwheel), Prefix + "layerwheel");
190  iEvent.put(std::move(stringringrod), Prefix + "stringringrod");
191  iEvent.put(std::move(petal), Prefix + "petal");
192  iEvent.put(std::move(stereo), Prefix + "stereo");
193 }

References edmNew::DetSetVector< T >::begin(), ALCARECOTkAlJpsiMuMu_cff::charge, bsc_activity_cfg::clusters, edmNew::DetSetVector< T >::end(), ShallowClustersProducer::NearDigis::eta(), PVValHelper::eta, ShallowClustersProducer::NearDigis::etaasymm(), ShallowClustersProducer::NearDigis::etaX(), ShallowClustersProducer::NearDigis::first, edm::EventSetup::get(), get, edmNew::DetSetVector< T >::id(), iEvent, info(), SiStripClusterInfo::initEvent(), edm::HandleBase::isValid(), ShallowClustersProducer::NearDigis::last, ShallowClustersProducer::moduleVars::layerwheel, ShallowClustersProducer::NearDigis::left, ShallowClustersProducer::NearDigis::Lleft, ShallowClustersProducer::NearDigis::max, ShallowClustersProducer::moduleVars::module, eostools::move(), hgcalDigitizer_cfi::noise, contentValuesFiles::number, ShallowClustersProducer::NearDigis::outsideasymm(), ShallowClustersProducer::moduleVars::petal, funct::pow(), Prefix, edm::ESHandle< T >::product(), ShallowClustersProducer::NearDigis::right, ShallowClustersProducer::NearDigis::Rright, SiStripClusterInfo::setCluster(), ShallowClustersProducer::moduleVars::side, siStripClusterInfo_, mathSSE::sqrt(), ShallowClustersProducer::moduleVars::stereo, ShallowClustersProducer::moduleVars::stringringrod, ShallowClustersProducer::moduleVars::subdetid, theClustersToken_, theDigisToken_, and ApeEstimator_cff::width.

Member Data Documentation

◆ Prefix

std::string ShallowClustersProducer::Prefix
private

Definition at line 23 of file ShallowClustersProducer.h.

Referenced by produce(), and ShallowClustersProducer().

◆ siStripClusterInfo_

SiStripClusterInfo ShallowClustersProducer::siStripClusterInfo_
private

Definition at line 44 of file ShallowClustersProducer.h.

Referenced by produce().

◆ theClustersLabel

edm::InputTag ShallowClustersProducer::theClustersLabel
private

Definition at line 22 of file ShallowClustersProducer.h.

◆ theClustersToken_

edm::EDGetTokenT<edmNew::DetSetVector<SiStripCluster> > ShallowClustersProducer::theClustersToken_
private

Definition at line 42 of file ShallowClustersProducer.h.

Referenced by produce(), and ShallowClustersProducer().

◆ theDigisToken_

edm::EDGetTokenT<edm::DetSetVector<SiStripProcessedRawDigi> > ShallowClustersProducer::theDigisToken_
private

Definition at line 43 of file ShallowClustersProducer.h.

Referenced by produce(), and ShallowClustersProducer().

SiStripClusterInfo
Definition: SiStripClusterInfo.h:21
edm::ESHandle::product
T const * product() const
Definition: ESHandle.h:86
ApeEstimator_cff.width
width
Definition: ApeEstimator_cff.py:24
edmNew::DetSetVector::id
id_type id(size_t cell) const
Definition: DetSetVectorNew.h:606
TrackerTopology
Definition: TrackerTopology.h:16
edmNew::DetSetVector::const_iterator
boost::transform_iterator< IterHelp, const_IdIter > const_iterator
Definition: DetSetVectorNew.h:231
edm::EDConsumerBase::consumesCollector
ConsumesCollector consumesCollector()
Use a ConsumesCollector to gather consumes information from helper functions.
Definition: EDConsumerBase.cc:71
info
static const TGPicture * info(bool iBackgroundIsBlack)
Definition: FWCollectionSummaryWidget.cc:152
edmNew::DetSetVector::begin
const_iterator begin(bool update=false) const
Definition: DetSetVectorNew.h:572
edm::Handle
Definition: AssociativeIterator.h:50
edm::EventSetup::get
T get() const
Definition: EventSetup.h:73
contentValuesFiles.number
number
Definition: contentValuesFiles.py:53
PVValHelper::eta
Definition: PVValidationHelpers.h:69
mathSSE::sqrt
T sqrt(T t)
Definition: SSEVec.h:19
edm::ESHandle< TrackerTopology >
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
bsc_activity_cfg.clusters
clusters
Definition: bsc_activity_cfg.py:36
ALCARECOTkAlJpsiMuMu_cff.charge
charge
Definition: ALCARECOTkAlJpsiMuMu_cff.py:47
SiStripClusterInfo::setCluster
void setCluster(const SiStripCluster &cluster, int detId)
Definition: SiStripClusterInfo.cc:16
HLT_2018_cff.InputTag
InputTag
Definition: HLT_2018_cff.py:79016
hgcalDigitizer_cfi.noise
noise
Definition: hgcalDigitizer_cfi.py:150
iEvent
int iEvent
Definition: GenABIO.cc:224
module
Definition: vlib.h:198
get
#define get
ShallowClustersProducer::Prefix
std::string Prefix
Definition: ShallowClustersProducer.h:23
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
ShallowClustersProducer::theClustersToken_
edm::EDGetTokenT< edmNew::DetSetVector< SiStripCluster > > theClustersToken_
Definition: ShallowClustersProducer.h:42
SiStripClusterInfo::initEvent
void initEvent(const edm::EventSetup &iSetup)
Definition: SiStripClusterInfo.cc:10
eostools.move
def move(src, dest)
Definition: eostools.py:511
edmNew::DetSetVector::end
const_iterator end(bool update=false) const
Definition: DetSetVectorNew.h:577
ShallowClustersProducer::theDigisToken_
edm::EDGetTokenT< edm::DetSetVector< SiStripProcessedRawDigi > > theDigisToken_
Definition: ShallowClustersProducer.h:43
funct::pow
Power< A, B >::type pow(const A &a, const B &b)
Definition: Power.h:30
TrackerTopologyRcd
Definition: TrackerTopologyRcd.h:10
edm::HandleBase::isValid
bool isValid() const
Definition: HandleBase.h:70
edm::InputTag
Definition: InputTag.h:15
ShallowClustersProducer::siStripClusterInfo_
SiStripClusterInfo siStripClusterInfo_
Definition: ShallowClustersProducer.h:44
edmNew::DetSet::const_iterator
const data_type * const_iterator
Definition: DetSetNew.h:31