CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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 ()
 
ModuleDescription const & moduleDescription () const
 
virtual ~EDProducer ()
 
- Public Member Functions inherited from edm::ProducerBase
 ProducerBase ()
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
std::function< void(BranchDescription
const &)> 
registrationCallback () const
 used by the fwk to register list of products More...
 
virtual ~ProducerBase ()
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
 EDConsumerBase ()
 
ProductHolderIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
std::vector
< ProductHolderIndexAndSkipBit >
const & 
itemsToGetFromEvent () const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesDependentUpon (const std::string &iProcessName, std::vector< const char * > &oModuleLabels) const
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
bool registeredToConsume (ProductHolderIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductHolderIndexHelper const &)
 
virtual ~EDConsumerBase ()
 

Private Member Functions

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

Private Attributes

std::string Prefix
 
edm::InputTag theClustersLabel
 
edm::EDGetTokenT
< edm::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
typedef
ProductRegistryHelper::TypeLabelList 
TypeLabelList
 
- Static Public Member Functions inherited from edm::EDProducer
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 
- Protected Member Functions inherited from edm::ProducerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
- Protected Member Functions inherited from edm::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
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 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)
 

Detailed Description

Definition at line 16 of file ShallowClustersProducer.h.

Constructor & Destructor Documentation

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

Definition at line 13 of file ShallowClustersProducer.cc.

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

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

Member Function Documentation

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

Implements edm::EDProducer.

Definition at line 58 of file ShallowClustersProducer.cc.

References edmNew::DetSetVector< T >::begin(), SiStripClusterInfo::charge(), HLT_25ns14e33_v1_cff::clusters, cond::rpcobgas::detid, edmNew::DetSetVector< T >::end(), ShallowClustersProducer::NearDigis::eta(), eta(), ShallowClustersProducer::NearDigis::etaasymm(), ShallowClustersProducer::NearDigis::etaX(), ShallowClustersProducer::NearDigis::first, SiStripClusterInfo::firstStrip(), edm::EventSetup::get(), edm::Event::getByToken(), edmNew::DetSetVector< T >::id(), info(), SiStripClusterInfo::IsAnythingBad(), edm::HandleBase::isValid(), ShallowClustersProducer::NearDigis::last, ShallowClustersProducer::moduleVars::layerwheel, ShallowClustersProducer::NearDigis::left, ShallowClustersProducer::NearDigis::Lleft, ShallowClustersProducer::NearDigis::max, SiStripClusterInfo::maxCharge(), SiStripClusterInfo::maxIndex(), SiStripClusterInfo::maxStrip(), ShallowClustersProducer::moduleVars::module, python.rootplot.argparse::module, HLT_25ns14e33_v1_cff::noise, SiStripClusterInfo::noiseRescaledByGain(), contentValuesFiles::number, ShallowClustersProducer::NearDigis::outsideasymm(), ShallowClustersProducer::moduleVars::petal, funct::pow(), Prefix, edm::ESHandle< class >::product(), edm::Event::put(), ShallowClustersProducer::NearDigis::right, ShallowClustersProducer::NearDigis::Rright, ShallowClustersProducer::moduleVars::side, SiStripClusterInfo::signalOverNoise(), mathSSE::sqrt(), ShallowClustersProducer::moduleVars::stereo, ShallowClustersProducer::moduleVars::stringringrod, SiStripClusterInfo::stripGains(), SiStripClusterInfo::stripNoisesRescaledByGain(), ShallowClustersProducer::moduleVars::subdetid, theClustersToken_, theDigisToken_, SiStripClusterInfo::variance(), SiStripClusterInfo::width(), and create_public_lumi_plots::width.

Referenced by JSONExport.JsonExport::export(), HTMLExport.HTMLExport::export(), and HTMLExport.HTMLExportStatic::export().

58  {
59  //Retrieve tracker topology from geometry
61  iSetup.get<IdealGeometryRecord>().get(tTopoHandle);
62  const TrackerTopology* const tTopo = tTopoHandle.product();
63 
64  std::auto_ptr<std::vector<unsigned> > number ( new std::vector<unsigned>(7,0) );
65  std::auto_ptr<std::vector<unsigned> > width ( new std::vector<unsigned>() );
66  std::auto_ptr<std::vector<float> > variance ( new std::vector<float>() );
67  std::auto_ptr<std::vector<float> > barystrip ( new std::vector<float>() );
68  std::auto_ptr<std::vector<float> > middlestrip ( new std::vector<float>() );
69  std::auto_ptr<std::vector<unsigned> > charge ( new std::vector<unsigned>() );
70  std::auto_ptr<std::vector<float> > noise ( new std::vector<float>() );
71  std::auto_ptr<std::vector<float> > ston ( new std::vector<float>() );
72  std::auto_ptr<std::vector<unsigned> > seedstrip ( new std::vector<unsigned>() );
73  std::auto_ptr<std::vector<unsigned> > seedindex ( new std::vector<unsigned>() );
74  std::auto_ptr<std::vector<unsigned> > seedcharge ( new std::vector<unsigned>() );
75  std::auto_ptr<std::vector<float> > seednoise ( new std::vector<float>() );
76  std::auto_ptr<std::vector<float> > seedgain ( new std::vector<float>() );
77  std::auto_ptr<std::vector<unsigned> > qualityisbad ( new std::vector<unsigned>() );
78 
79  std::auto_ptr<std::vector<float> > rawchargeC ( new std::vector<float>() );
80  std::auto_ptr<std::vector<float> > rawchargeL ( new std::vector<float>() );
81  std::auto_ptr<std::vector<float> > rawchargeR ( new std::vector<float>() );
82  std::auto_ptr<std::vector<float> > rawchargeLL ( new std::vector<float>() );
83  std::auto_ptr<std::vector<float> > rawchargeRR ( new std::vector<float>() );
84  std::auto_ptr<std::vector<float> > etaX ( new std::vector<float>() );
85  std::auto_ptr<std::vector<float> > eta ( new std::vector<float>() );
86  std::auto_ptr<std::vector<float> > foldedeta ( new std::vector<float>() );
87  std::auto_ptr<std::vector<float> > etaasymm ( new std::vector<float>() );
88  std::auto_ptr<std::vector<float> > outsideasymm ( new std::vector<float>() );
89  std::auto_ptr<std::vector<float> > neweta ( new std::vector<float>() );
90  std::auto_ptr<std::vector<float> > newetaerr ( new std::vector<float>() );
91 
92  std::auto_ptr<std::vector<unsigned> > detid ( new std::vector<unsigned>() );
93  std::auto_ptr<std::vector<int> > subdetid ( new std::vector<int>() );
94  std::auto_ptr<std::vector<int> > side ( new std::vector<int>() );
95  std::auto_ptr<std::vector<int> > module ( new std::vector<int>() );
96  std::auto_ptr<std::vector<int> > layerwheel ( new std::vector<int>() );
97  std::auto_ptr<std::vector<int> > stringringrod ( new std::vector<int>() );
98  std::auto_ptr<std::vector<int> > petal ( new std::vector<int>() );
99  std::auto_ptr<std::vector<int> > stereo ( new std::vector<int>());
100 
102  // iEvent.getByLabel(theClustersLabel, clusters);
103  iEvent.getByToken(theClustersToken_, clusters);
104 
106  // iEvent.getByLabel("siStripProcessedRawDigis", "", rawProcessedDigis);
107  iEvent.getByToken(theDigisToken_,rawProcessedDigis);
108 
109  edmNew::DetSetVector<SiStripCluster>::const_iterator itClusters=clusters->begin();
110  for(;itClusters!=clusters->end();++itClusters){
111  uint32_t id = itClusters->id();
112  const moduleVars moduleV(id, tTopo);
113  for(edmNew::DetSet<SiStripCluster>::const_iterator cluster=itClusters->begin(); cluster!=itClusters->end();++cluster){
114 
115  const SiStripClusterInfo info(*cluster, iSetup, 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( number, Prefix + "number" );
158  iEvent.put( width, Prefix + "width" );
159  iEvent.put( variance, Prefix + "variance" );
160  iEvent.put( barystrip, Prefix + "barystrip" );
161  iEvent.put( middlestrip, Prefix + "middlestrip" );
162  iEvent.put( charge, Prefix + "charge" );
163  iEvent.put( noise, Prefix + "noise" );
164  iEvent.put( ston, Prefix + "ston" );
165  iEvent.put( seedstrip, Prefix + "seedstrip" );
166  iEvent.put( seedindex, Prefix + "seedindex" );
167  iEvent.put( seedcharge, Prefix + "seedcharge" );
168  iEvent.put( seednoise, Prefix + "seednoise" );
169  iEvent.put( seedgain, Prefix + "seedgain" );
170  iEvent.put( qualityisbad, Prefix + "qualityisbad" );
171 
172  iEvent.put( rawchargeC, Prefix + "rawchargeC" );
173  iEvent.put( rawchargeL, Prefix + "rawchargeL" );
174  iEvent.put( rawchargeR, Prefix + "rawchargeR" );
175  iEvent.put( rawchargeLL, Prefix + "rawchargeLL" );
176  iEvent.put( rawchargeRR, Prefix + "rawchargeRR" );
177  iEvent.put( etaX, Prefix + "etaX" );
178  iEvent.put( eta, Prefix + "eta" );
179  iEvent.put( foldedeta, Prefix + "foldedeta" );
180  iEvent.put( etaasymm, Prefix + "etaasymm" );
181  iEvent.put( outsideasymm, Prefix + "outsideasymm" );
182  iEvent.put( neweta, Prefix + "neweta" );
183  iEvent.put( newetaerr, Prefix + "newetaerr" );
184 
185  iEvent.put( detid, Prefix + "detid" );
186  iEvent.put( subdetid, Prefix + "subdetid" );
187  iEvent.put( module, Prefix + "module" );
188  iEvent.put( side, Prefix + "side" );
189  iEvent.put( layerwheel, Prefix + "layerwheel" );
190  iEvent.put( stringringrod, Prefix + "stringringrod" );
191  iEvent.put( petal, Prefix + "petal" );
192  iEvent.put( stereo, Prefix + "stereo" );
193 
194 }
boost::transform_iterator< IterHelp, const_IdIter > const_iterator
const_iterator end(bool update=false) const
static const TGPicture * info(bool iBackgroundIsBlack)
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:449
data_type const * const_iterator
Definition: DetSetNew.h:30
T eta() const
id_type id(size_t cell) const
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
Definition: Event.h:113
T sqrt(T t)
Definition: SSEVec.h:48
edm::EDGetTokenT< edm::DetSetVector< SiStripCluster > > theClustersToken_
bool isValid() const
Definition: HandleBase.h:75
const T & get() const
Definition: EventSetup.h:55
T const * product() const
Definition: ESHandle.h:86
edm::EDGetTokenT< edm::DetSetVector< SiStripProcessedRawDigi > > theDigisToken_
Definition: vlib.h:208
Power< A, B >::type pow(const A &a, const B &b)
Definition: Power.h:40
const_iterator begin(bool update=false) const

Member Data Documentation

std::string ShallowClustersProducer::Prefix
private

Definition at line 25 of file ShallowClustersProducer.h.

Referenced by produce(), and ShallowClustersProducer().

edm::InputTag ShallowClustersProducer::theClustersLabel
private

Definition at line 24 of file ShallowClustersProducer.h.

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

Definition at line 44 of file ShallowClustersProducer.h.

Referenced by produce(), and ShallowClustersProducer().

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

Definition at line 45 of file ShallowClustersProducer.h.

Referenced by produce(), and ShallowClustersProducer().