CMS 3D CMS Logo

List of all members | Classes | Public Member Functions | Private Member Functions | Private Attributes
ShallowClustersProducer Class Reference
Inheritance diagram for ShallowClustersProducer:
edm::stream::EDProducer<>

Classes

struct  moduleVars
 
struct  NearDigis
 

Public Member Functions

 ShallowClustersProducer (const edm::ParameterSet &)
 
- Public Member Functions inherited from edm::stream::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
 
const EDProduceroperator= (const EDProducer &)=delete
 

Private Member Functions

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

Private Attributes

std::string Prefix
 
SiStripClusterInfo siStripClusterInfo_
 
edm::InputTag theClustersLabel
 
edm::EDGetTokenT< edmNew::DetSetVector< SiStripCluster > > theClustersToken_
 
edm::EDGetTokenT< edm::DetSetVector< SiStripProcessedRawDigi > > theDigisToken_
 
const edm::ESGetToken< TrackerTopology, TrackerTopologyRcdtopoToken_
 

Additional Inherited Members

- Public Types inherited from edm::stream::EDProducer<>
using CacheTypes = CacheContexts< T... >
 
using GlobalCache = typename CacheTypes::GlobalCache
 
using HasAbility = AbilityChecker< T... >
 
using InputProcessBlockCache = typename CacheTypes::InputProcessBlockCache
 
using LuminosityBlockCache = typename CacheTypes::LuminosityBlockCache
 
using LuminosityBlockContext = LuminosityBlockContextT< LuminosityBlockCache, RunCache, GlobalCache >
 
using LuminosityBlockSummaryCache = typename CacheTypes::LuminosityBlockSummaryCache
 
using RunCache = typename CacheTypes::RunCache
 
using RunContext = RunContextT< RunCache, GlobalCache >
 
using RunSummaryCache = typename CacheTypes::RunSummaryCache
 

Detailed Description

Definition at line 18 of file ShallowClustersProducer.cc.

Constructor & Destructor Documentation

◆ ShallowClustersProducer()

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

Definition at line 52 of file ShallowClustersProducer.cc.

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

53  : Prefix(iConfig.getParameter<std::string>("Prefix")),
54  topoToken_(esConsumes<TrackerTopology, TrackerTopologyRcd>()),
55  siStripClusterInfo_(consumesCollector()) {
56  produces<std::vector<unsigned>>(Prefix + "number");
57  produces<std::vector<unsigned>>(Prefix + "width");
58  produces<std::vector<float>>(Prefix + "variance");
59  produces<std::vector<float>>(Prefix + "barystrip");
60  produces<std::vector<float>>(Prefix + "middlestrip");
61  produces<std::vector<unsigned>>(Prefix + "charge");
62  produces<std::vector<float>>(Prefix + "noise");
63  produces<std::vector<float>>(Prefix + "ston");
64  produces<std::vector<unsigned>>(Prefix + "seedstrip");
65  produces<std::vector<unsigned>>(Prefix + "seedindex");
66  produces<std::vector<unsigned>>(Prefix + "seedcharge");
67  produces<std::vector<float>>(Prefix + "seednoise");
68  produces<std::vector<float>>(Prefix + "seedgain");
69  produces<std::vector<unsigned>>(Prefix + "qualityisbad");
70 
71  produces<std::vector<float>>(Prefix + "rawchargeC");
72  produces<std::vector<float>>(Prefix + "rawchargeL");
73  produces<std::vector<float>>(Prefix + "rawchargeR");
74  produces<std::vector<float>>(Prefix + "rawchargeLL");
75  produces<std::vector<float>>(Prefix + "rawchargeRR");
76  produces<std::vector<float>>(Prefix + "eta");
77  produces<std::vector<float>>(Prefix + "foldedeta");
78  produces<std::vector<float>>(Prefix + "etaX");
79  produces<std::vector<float>>(Prefix + "etaasymm");
80  produces<std::vector<float>>(Prefix + "outsideasymm");
81  produces<std::vector<float>>(Prefix + "neweta");
82  produces<std::vector<float>>(Prefix + "newetaerr");
83 
84  produces<std::vector<unsigned>>(Prefix + "detid");
85  produces<std::vector<int>>(Prefix + "subdetid");
86  produces<std::vector<int>>(Prefix + "module");
87  produces<std::vector<int>>(Prefix + "side");
88  produces<std::vector<int>>(Prefix + "layerwheel");
89  produces<std::vector<int>>(Prefix + "stringringrod");
90  produces<std::vector<int>>(Prefix + "petal");
91  produces<std::vector<int>>(Prefix + "stereo");
92 
93  theClustersToken_ = consumes<edmNew::DetSetVector<SiStripCluster>>(iConfig.getParameter<edm::InputTag>("Clusters"));
94  theDigisToken_ = consumes<edm::DetSetVector<SiStripProcessedRawDigi>>(edm::InputTag("siStripProcessedRawDigis", ""));
95 }
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
const edm::ESGetToken< TrackerTopology, TrackerTopologyRcd > topoToken_
edm::EDGetTokenT< edmNew::DetSetVector< SiStripCluster > > theClustersToken_
edm::EDGetTokenT< edm::DetSetVector< SiStripProcessedRawDigi > > theDigisToken_
SiStripClusterInfo siStripClusterInfo_

Member Function Documentation

◆ produce()

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

Definition at line 97 of file ShallowClustersProducer.cc.

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::getHandle(), 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, callgraph::module, eostools::move(), hgchebackDigitizer_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_, topoToken_, and ApeEstimator_cff::width.

97  {
98  //Retrieve tracker topology from geometry
100  const TrackerTopology* const tTopo = tTopoHandle.product();
101 
103 
104  auto number = std::make_unique<std::vector<unsigned>>(7, 0);
105  auto width = std::make_unique<std::vector<unsigned>>();
106  auto variance = std::make_unique<std::vector<float>>();
107  auto barystrip = std::make_unique<std::vector<float>>();
108  auto middlestrip = std::make_unique<std::vector<float>>();
109  auto charge = std::make_unique<std::vector<unsigned>>();
110  auto noise = std::make_unique<std::vector<float>>();
111  auto ston = std::make_unique<std::vector<float>>();
112  auto seedstrip = std::make_unique<std::vector<unsigned>>();
113  auto seedindex = std::make_unique<std::vector<unsigned>>();
114  auto seedcharge = std::make_unique<std::vector<unsigned>>();
115  auto seednoise = std::make_unique<std::vector<float>>();
116  auto seedgain = std::make_unique<std::vector<float>>();
117  auto qualityisbad = std::make_unique<std::vector<unsigned>>();
118 
119  auto rawchargeC = std::make_unique<std::vector<float>>();
120  auto rawchargeL = std::make_unique<std::vector<float>>();
121  auto rawchargeR = std::make_unique<std::vector<float>>();
122  auto rawchargeLL = std::make_unique<std::vector<float>>();
123  auto rawchargeRR = std::make_unique<std::vector<float>>();
124  auto etaX = std::make_unique<std::vector<float>>();
125  auto eta = std::make_unique<std::vector<float>>();
126  auto foldedeta = std::make_unique<std::vector<float>>();
127  auto etaasymm = std::make_unique<std::vector<float>>();
128  auto outsideasymm = std::make_unique<std::vector<float>>();
129  auto neweta = std::make_unique<std::vector<float>>();
130  auto newetaerr = std::make_unique<std::vector<float>>();
131 
132  auto detid = std::make_unique<std::vector<unsigned>>();
133  auto subdetid = std::make_unique<std::vector<int>>();
134  auto side = std::make_unique<std::vector<int>>();
135  auto module = std::make_unique<std::vector<int>>();
136  auto layerwheel = std::make_unique<std::vector<int>>();
137  auto stringringrod = std::make_unique<std::vector<int>>();
138  auto petal = std::make_unique<std::vector<int>>();
139  auto stereo = std::make_unique<std::vector<int>>();
140 
142  // iEvent.getByLabel(theClustersLabel, clusters);
143  iEvent.getByToken(theClustersToken_, clusters);
144 
146  // iEvent.getByLabel("siStripProcessedRawDigis", "", rawProcessedDigis);
147  iEvent.getByToken(theDigisToken_, rawProcessedDigis);
148 
150  for (; itClusters != clusters->end(); ++itClusters) {
151  uint32_t id = itClusters->id();
152  const moduleVars moduleV(id, tTopo);
153  for (edmNew::DetSet<SiStripCluster>::const_iterator cluster = itClusters->begin(); cluster != itClusters->end();
154  ++cluster) {
155  siStripClusterInfo_.setCluster(*cluster, id);
157  const NearDigis digis = rawProcessedDigis.isValid() ? NearDigis(info, *rawProcessedDigis) : NearDigis(info);
158 
159  (number->at(0))++;
160  (number->at(moduleV.subdetid))++;
161  width->push_back(cluster->amplitudes().size());
162  barystrip->push_back(cluster->barycenter());
163  variance->push_back(info.variance());
164  middlestrip->push_back(info.firstStrip() + info.width() / 2.0);
165  charge->push_back(info.charge());
166  noise->push_back(info.noiseRescaledByGain());
167  ston->push_back(info.signalOverNoise());
168  seedstrip->push_back(info.maxStrip());
169  seedindex->push_back(info.maxIndex());
170  seedcharge->push_back(info.maxCharge());
171  seednoise->push_back(info.stripNoisesRescaledByGain().at(info.maxIndex()));
172  seedgain->push_back(info.stripGains().at(info.maxIndex()));
173  qualityisbad->push_back(info.IsAnythingBad());
174 
175  rawchargeC->push_back(digis.max);
176  rawchargeL->push_back(digis.left);
177  rawchargeR->push_back(digis.right);
178  rawchargeLL->push_back(digis.Lleft);
179  rawchargeRR->push_back(digis.Rright);
180  etaX->push_back(digis.etaX());
181  eta->push_back(digis.eta());
182  etaasymm->push_back(digis.etaasymm());
183  outsideasymm->push_back(digis.outsideasymm());
184  neweta->push_back((digis.last - digis.first) / info.charge());
185  newetaerr->push_back((sqrt(digis.last + digis.first)) / pow(info.charge(), 1.5));
186 
187  detid->push_back(id);
188  subdetid->push_back(moduleV.subdetid);
189  side->push_back(moduleV.side);
190  module->push_back(moduleV.module);
191  layerwheel->push_back(moduleV.layerwheel);
192  stringringrod->push_back(moduleV.stringringrod);
193  petal->push_back(moduleV.petal);
194  stereo->push_back(moduleV.stereo);
195  }
196  }
197 
198  iEvent.put(std::move(number), Prefix + "number");
199  iEvent.put(std::move(width), Prefix + "width");
200  iEvent.put(std::move(variance), Prefix + "variance");
201  iEvent.put(std::move(barystrip), Prefix + "barystrip");
202  iEvent.put(std::move(middlestrip), Prefix + "middlestrip");
203  iEvent.put(std::move(charge), Prefix + "charge");
204  iEvent.put(std::move(noise), Prefix + "noise");
205  iEvent.put(std::move(ston), Prefix + "ston");
206  iEvent.put(std::move(seedstrip), Prefix + "seedstrip");
207  iEvent.put(std::move(seedindex), Prefix + "seedindex");
208  iEvent.put(std::move(seedcharge), Prefix + "seedcharge");
209  iEvent.put(std::move(seednoise), Prefix + "seednoise");
210  iEvent.put(std::move(seedgain), Prefix + "seedgain");
211  iEvent.put(std::move(qualityisbad), Prefix + "qualityisbad");
212 
213  iEvent.put(std::move(rawchargeC), Prefix + "rawchargeC");
214  iEvent.put(std::move(rawchargeL), Prefix + "rawchargeL");
215  iEvent.put(std::move(rawchargeR), Prefix + "rawchargeR");
216  iEvent.put(std::move(rawchargeLL), Prefix + "rawchargeLL");
217  iEvent.put(std::move(rawchargeRR), Prefix + "rawchargeRR");
218  iEvent.put(std::move(etaX), Prefix + "etaX");
219  iEvent.put(std::move(eta), Prefix + "eta");
220  iEvent.put(std::move(foldedeta), Prefix + "foldedeta");
221  iEvent.put(std::move(etaasymm), Prefix + "etaasymm");
222  iEvent.put(std::move(outsideasymm), Prefix + "outsideasymm");
223  iEvent.put(std::move(neweta), Prefix + "neweta");
224  iEvent.put(std::move(newetaerr), Prefix + "newetaerr");
225 
226  iEvent.put(std::move(detid), Prefix + "detid");
227  iEvent.put(std::move(subdetid), Prefix + "subdetid");
228  iEvent.put(std::move(module), Prefix + "module");
229  iEvent.put(std::move(side), Prefix + "side");
230  iEvent.put(std::move(layerwheel), Prefix + "layerwheel");
231  iEvent.put(std::move(stringringrod), Prefix + "stringringrod");
232  iEvent.put(std::move(petal), Prefix + "petal");
233  iEvent.put(std::move(stereo), Prefix + "stereo");
234 }
static const TGPicture * info(bool iBackgroundIsBlack)
void setCluster(const SiStripCluster &cluster, int detId)
const edm::ESGetToken< TrackerTopology, TrackerTopologyRcd > topoToken_
data_type const * const_iterator
Definition: DetSetNew.h:31
const_iterator end(bool update=false) const
int iEvent
Definition: GenABIO.cc:224
T const * product() const
Definition: ESHandle.h:86
T sqrt(T t)
Definition: SSEVec.h:19
id_type id(size_t cell) const
ESHandle< T > getHandle(const ESGetToken< T, R > &iToken) const
Definition: EventSetup.h:151
boost::transform_iterator< IterHelp, const_IdIter > const_iterator
const_iterator begin(bool update=false) const
bool isValid() const
Definition: HandleBase.h:70
edm::EDGetTokenT< edmNew::DetSetVector< SiStripCluster > > theClustersToken_
edm::EDGetTokenT< edm::DetSetVector< SiStripProcessedRawDigi > > theDigisToken_
SiStripClusterInfo siStripClusterInfo_
void initEvent(const edm::EventSetup &iSetup)
Power< A, B >::type pow(const A &a, const B &b)
Definition: Power.h:29
def move(src, dest)
Definition: eostools.py:511

Member Data Documentation

◆ Prefix

std::string ShallowClustersProducer::Prefix
private

Definition at line 24 of file ShallowClustersProducer.cc.

Referenced by produce(), and ShallowClustersProducer().

◆ siStripClusterInfo_

SiStripClusterInfo ShallowClustersProducer::siStripClusterInfo_
private

Definition at line 46 of file ShallowClustersProducer.cc.

Referenced by produce().

◆ theClustersLabel

edm::InputTag ShallowClustersProducer::theClustersLabel
private

Definition at line 23 of file ShallowClustersProducer.cc.

◆ theClustersToken_

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

Definition at line 44 of file ShallowClustersProducer.cc.

Referenced by produce(), and ShallowClustersProducer().

◆ theDigisToken_

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

Definition at line 45 of file ShallowClustersProducer.cc.

Referenced by produce(), and ShallowClustersProducer().

◆ topoToken_

const edm::ESGetToken<TrackerTopology, TrackerTopologyRcd> ShallowClustersProducer::topoToken_
private

Definition at line 43 of file ShallowClustersProducer.cc.

Referenced by produce().