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::ProductRegistryHelper

Classes

struct  moduleVars
 
struct  NearDigis
 

Public Member Functions

 ShallowClustersProducer (const edm::ParameterSet &)
 
- Public Member Functions inherited from edm::EDProducer
 EDProducer ()
 
virtual ~EDProducer ()
 
- Public Member Functions inherited from edm::ProducerBase
 ProducerBase ()
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
boost::function< void(const
BranchDescription &)> 
registrationCallback () const
 used by the fwk to register list of products More...
 
virtual ~ProducerBase ()
 

Private Member Functions

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

Private Attributes

std::string Prefix
 
edm::InputTag theClustersLabel
 

Additional Inherited Members

- Public Types inherited from edm::EDProducer
typedef EDProducer ModuleType
 
typedef WorkerT< EDProducerWorkerType
 
- 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::EDProducer
CurrentProcessingContext const * currentContext () const
 
- Protected Member Functions inherited from edm::ProducerBase
template<class TProducer , class TMethod >
void callWhenNewProductsRegistered (TProducer *iProd, TMethod iMethod)
 

Detailed Description

Definition at line 11 of file ShallowClustersProducer.h.

Constructor & Destructor Documentation

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

Definition at line 15 of file ShallowClustersProducer.cc.

References Prefix.

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

Member Function Documentation

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

Implements edm::EDProducer.

Definition at line 59 of file ShallowClustersProducer.cc.

References edmNew::DetSetVector< T >::begin(), DeDxDiscriminatorTools::charge(), SiStripClusterInfo::charge(), cond::rpcobgas::detid, edmNew::DetSetVector< T >::end(), ShallowClustersProducer::NearDigis::eta(), eta(), ShallowClustersProducer::NearDigis::etaasymm(), ShallowClustersProducer::NearDigis::etaX(), ShallowClustersProducer::NearDigis::first, SiStripClusterInfo::firstStrip(), edm::Event::getByLabel(), 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, SiStripClusterInfo::noiseRescaledByGain(), ShallowClustersProducer::NearDigis::outsideasymm(), ShallowClustersProducer::moduleVars::petal, funct::pow(), Prefix, 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, theClustersLabel, SiStripClusterInfo::variance(), SiStripClusterInfo::width(), and tablePrinter::width.

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

59  {
60  std::auto_ptr<std::vector<unsigned> > number ( new std::vector<unsigned>(7,0) );
61  std::auto_ptr<std::vector<unsigned> > width ( new std::vector<unsigned>() );
62  std::auto_ptr<std::vector<float> > variance ( new std::vector<float>() );
63  std::auto_ptr<std::vector<float> > barystrip ( new std::vector<float>() );
64  std::auto_ptr<std::vector<float> > middlestrip ( new std::vector<float>() );
65  std::auto_ptr<std::vector<unsigned> > charge ( new std::vector<unsigned>() );
66  std::auto_ptr<std::vector<float> > noise ( new std::vector<float>() );
67  std::auto_ptr<std::vector<float> > ston ( new std::vector<float>() );
68  std::auto_ptr<std::vector<unsigned> > seedstrip ( new std::vector<unsigned>() );
69  std::auto_ptr<std::vector<unsigned> > seedindex ( new std::vector<unsigned>() );
70  std::auto_ptr<std::vector<unsigned> > seedcharge ( new std::vector<unsigned>() );
71  std::auto_ptr<std::vector<float> > seednoise ( new std::vector<float>() );
72  std::auto_ptr<std::vector<float> > seedgain ( new std::vector<float>() );
73  std::auto_ptr<std::vector<unsigned> > qualityisbad ( new std::vector<unsigned>() );
74 
75  std::auto_ptr<std::vector<float> > rawchargeC ( new std::vector<float>() );
76  std::auto_ptr<std::vector<float> > rawchargeL ( new std::vector<float>() );
77  std::auto_ptr<std::vector<float> > rawchargeR ( new std::vector<float>() );
78  std::auto_ptr<std::vector<float> > rawchargeLL ( new std::vector<float>() );
79  std::auto_ptr<std::vector<float> > rawchargeRR ( new std::vector<float>() );
80  std::auto_ptr<std::vector<float> > etaX ( new std::vector<float>() );
81  std::auto_ptr<std::vector<float> > eta ( new std::vector<float>() );
82  std::auto_ptr<std::vector<float> > foldedeta ( new std::vector<float>() );
83  std::auto_ptr<std::vector<float> > etaasymm ( new std::vector<float>() );
84  std::auto_ptr<std::vector<float> > outsideasymm ( new std::vector<float>() );
85  std::auto_ptr<std::vector<float> > neweta ( new std::vector<float>() );
86  std::auto_ptr<std::vector<float> > newetaerr ( new std::vector<float>() );
87 
88  std::auto_ptr<std::vector<unsigned> > detid ( new std::vector<unsigned>() );
89  std::auto_ptr<std::vector<int> > subdetid ( new std::vector<int>() );
90  std::auto_ptr<std::vector<int> > side ( new std::vector<int>() );
91  std::auto_ptr<std::vector<int> > module ( new std::vector<int>() );
92  std::auto_ptr<std::vector<int> > layerwheel ( new std::vector<int>() );
93  std::auto_ptr<std::vector<int> > stringringrod ( new std::vector<int>() );
94  std::auto_ptr<std::vector<int> > petal ( new std::vector<int>() );
95  std::auto_ptr<std::vector<int> > stereo ( new std::vector<int>());
96 
98  iEvent.getByLabel(theClustersLabel, clusters);
99 
101  iEvent.getByLabel("siStripProcessedRawDigis", "", rawProcessedDigis);
102 
103  edmNew::DetSetVector<SiStripCluster>::const_iterator itClusters=clusters->begin();
104  for(;itClusters!=clusters->end();++itClusters){
105  uint32_t id = itClusters->id();
106  const moduleVars moduleV(id);
107  for(edmNew::DetSet<SiStripCluster>::const_iterator cluster=itClusters->begin(); cluster!=itClusters->end();++cluster){
108 
109  const SiStripClusterInfo info(*cluster, iSetup, id);
110  const NearDigis digis = rawProcessedDigis.isValid() ? NearDigis(info, *rawProcessedDigis) : NearDigis(info);
111 
112  (number->at(0))++;
113  (number->at(moduleV.subdetid))++;
114  width->push_back( cluster->amplitudes().size() );
115  barystrip->push_back( cluster->barycenter() );
116  variance->push_back( info.variance() );
117  middlestrip->push_back( info.firstStrip() + info.width()/2.0 );
118  charge->push_back( info.charge() );
119  noise->push_back( info.noiseRescaledByGain() );
120  ston->push_back( info.signalOverNoise() );
121  seedstrip->push_back( info.maxStrip() );
122  seedindex->push_back( info.maxIndex() );
123  seedcharge->push_back( info.maxCharge() );
124  seednoise->push_back( info.stripNoisesRescaledByGain().at(info.maxIndex()) );
125  seedgain->push_back( info.stripGains().at(info.maxIndex()) );
126  qualityisbad->push_back( info.IsAnythingBad() );
127 
128  rawchargeC->push_back( digis.max );
129  rawchargeL->push_back( digis.left );
130  rawchargeR->push_back( digis.right );
131  rawchargeLL->push_back( digis.Lleft );
132  rawchargeRR->push_back( digis.Rright );
133  etaX->push_back( digis.etaX() );
134  eta->push_back( digis.eta() );
135  etaasymm->push_back( digis.etaasymm() );
136  outsideasymm->push_back( digis.outsideasymm() );
137  neweta->push_back( (digis.last-digis.first)/info.charge() );
138  newetaerr->push_back( (sqrt(digis.last+digis.first))/pow(info.charge(),1.5) );
139 
140  detid->push_back( id );
141  subdetid->push_back( moduleV.subdetid );
142  side->push_back( moduleV.side );
143  module->push_back( moduleV.module );
144  layerwheel->push_back( moduleV.layerwheel );
145  stringringrod->push_back( moduleV.stringringrod );
146  petal->push_back( moduleV.petal );
147  stereo->push_back( moduleV.stereo );
148  }
149  }
150 
151  iEvent.put( number, Prefix + "number" );
152  iEvent.put( width, Prefix + "width" );
153  iEvent.put( variance, Prefix + "variance" );
154  iEvent.put( barystrip, Prefix + "barystrip" );
155  iEvent.put( middlestrip, Prefix + "middlestrip" );
156  iEvent.put( charge, Prefix + "charge" );
157  iEvent.put( noise, Prefix + "noise" );
158  iEvent.put( ston, Prefix + "ston" );
159  iEvent.put( seedstrip, Prefix + "seedstrip" );
160  iEvent.put( seedindex, Prefix + "seedindex" );
161  iEvent.put( seedcharge, Prefix + "seedcharge" );
162  iEvent.put( seednoise, Prefix + "seednoise" );
163  iEvent.put( seedgain, Prefix + "seedgain" );
164  iEvent.put( qualityisbad, Prefix + "qualityisbad" );
165 
166  iEvent.put( rawchargeC, Prefix + "rawchargeC" );
167  iEvent.put( rawchargeL, Prefix + "rawchargeL" );
168  iEvent.put( rawchargeR, Prefix + "rawchargeR" );
169  iEvent.put( rawchargeLL, Prefix + "rawchargeLL" );
170  iEvent.put( rawchargeRR, Prefix + "rawchargeRR" );
171  iEvent.put( etaX, Prefix + "etaX" );
172  iEvent.put( eta, Prefix + "eta" );
173  iEvent.put( foldedeta, Prefix + "foldedeta" );
174  iEvent.put( etaasymm, Prefix + "etaasymm" );
175  iEvent.put( outsideasymm, Prefix + "outsideasymm" );
176  iEvent.put( neweta, Prefix + "neweta" );
177  iEvent.put( newetaerr, Prefix + "newetaerr" );
178 
179  iEvent.put( detid, Prefix + "detid" );
180  iEvent.put( subdetid, Prefix + "subdetid" );
181  iEvent.put( module, Prefix + "module" );
182  iEvent.put( side, Prefix + "side" );
183  iEvent.put( layerwheel, Prefix + "layerwheel" );
184  iEvent.put( stringringrod, Prefix + "stringringrod" );
185  iEvent.put( petal, Prefix + "petal" );
186  iEvent.put( stereo, Prefix + "stereo" );
187 
188 }
boost::transform_iterator< IterHelp, const_IdIter > const_iterator
const_iterator begin() const
data_type const * const_iterator
Definition: DetSetNew.h:25
T eta() const
id_type id(size_t cell) const
double charge(const std::vector< uint8_t > &Ampls)
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
Definition: Event.h:85
T sqrt(T t)
Definition: SSEVec.h:46
const_iterator end() const
bool isValid() const
Definition: HandleBase.h:76
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:356
Definition: vlib.h:209
Power< A, B >::type pow(const A &a, const B &b)
Definition: Power.h:40

Member Data Documentation

std::string ShallowClustersProducer::Prefix
private

Definition at line 20 of file ShallowClustersProducer.h.

Referenced by produce(), and ShallowClustersProducer().

edm::InputTag ShallowClustersProducer::theClustersLabel
private

Definition at line 19 of file ShallowClustersProducer.h.

Referenced by produce().