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)
 
- 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 SiStripCluster::amplitudes(), SiStripCluster::barycenter(), DeDxDiscriminatorTools::charge(), SiStripClusterInfo::charge(), cond::rpcobgas::detid, edmNew::DetSet< T >::detId(), ShallowClustersProducer::NearDigis::eta(), eta(), ShallowClustersProducer::NearDigis::etaasymm(), ShallowClustersProducer::NearDigis::etaX(), ShallowClustersProducer::NearDigis::first, SiStripClusterInfo::firstStrip(), edm::Event::getByLabel(), info, SiStripClusterInfo::IsAnythingBad(), edm::HandleBase::isValid(), ShallowClustersProducer::NearDigis::last, ShallowClustersProducer::NearDigis::left, ShallowClustersProducer::NearDigis::Lleft, ShallowClustersProducer::NearDigis::max, SiStripClusterInfo::maxCharge(), SiStripClusterInfo::maxIndex(), SiStripClusterInfo::maxStrip(), module(), SiStripClusterInfo::noiseRescaledByGain(), ShallowClustersProducer::NearDigis::outsideasymm(), funct::pow(), Prefix, edm::Event::put(), ShallowClustersProducer::NearDigis::right, ShallowClustersProducer::NearDigis::Rright, SiStripClusterInfo::signalOverNoise(), mathSSE::sqrt(), SiStripClusterInfo::stripGains(), SiStripClusterInfo::stripNoisesRescaledByGain(), theClustersLabel, SiStripClusterInfo::variance(), SiStripClusterInfo::width(), and tablePrinter::width.

Referenced by python.JSONExport.JsonExport::export(), and python.HTMLExport.HTMLExport::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  BOOST_FOREACH( const edmNew::DetSet<SiStripCluster> ds, *clusters) {
104  const moduleVars moduleV(ds.detId());
105  BOOST_FOREACH( const SiStripCluster cluster, ds) {
106  const SiStripClusterInfo info(cluster, iSetup);
107  const NearDigis digis = rawProcessedDigis.isValid() ? NearDigis(info, *rawProcessedDigis) : NearDigis(info);
108 
109  (number->at(0))++;
110  (number->at(moduleV.subdetid))++;
111  width->push_back( cluster.amplitudes().size() );
112  barystrip->push_back( cluster.barycenter() );
113  variance->push_back( info.variance() );
114  middlestrip->push_back( info.firstStrip() + info.width()/2.0 );
115  charge->push_back( info.charge() );
116  noise->push_back( info.noiseRescaledByGain() );
117  ston->push_back( info.signalOverNoise() );
118  seedstrip->push_back( info.maxStrip() );
119  seedindex->push_back( info.maxIndex() );
120  seedcharge->push_back( info.maxCharge() );
121  seednoise->push_back( info.stripNoisesRescaledByGain().at(info.maxIndex()) );
122  seedgain->push_back( info.stripGains().at(info.maxIndex()) );
123  qualityisbad->push_back( info.IsAnythingBad() );
124 
125  rawchargeC->push_back( digis.max );
126  rawchargeL->push_back( digis.left );
127  rawchargeR->push_back( digis.right );
128  rawchargeLL->push_back( digis.Lleft );
129  rawchargeRR->push_back( digis.Rright );
130  etaX->push_back( digis.etaX() );
131  eta->push_back( digis.eta() );
132  etaasymm->push_back( digis.etaasymm() );
133  outsideasymm->push_back( digis.outsideasymm() );
134  neweta->push_back( (digis.last-digis.first)/info.charge() );
135  newetaerr->push_back( (sqrt(digis.last+digis.first))/pow(info.charge(),1.5) );
136 
137  detid->push_back( ds.detId() );
138  subdetid->push_back( moduleV.subdetid );
139  side->push_back( moduleV.side );
140  module->push_back( moduleV.module );
141  layerwheel->push_back( moduleV.layerwheel );
142  stringringrod->push_back( moduleV.stringringrod );
143  petal->push_back( moduleV.petal );
144  stereo->push_back( moduleV.stereo );
145  }
146  }
147 
148  iEvent.put( number, Prefix + "number" );
149  iEvent.put( width, Prefix + "width" );
150  iEvent.put( variance, Prefix + "variance" );
151  iEvent.put( barystrip, Prefix + "barystrip" );
152  iEvent.put( middlestrip, Prefix + "middlestrip" );
153  iEvent.put( charge, Prefix + "charge" );
154  iEvent.put( noise, Prefix + "noise" );
155  iEvent.put( ston, Prefix + "ston" );
156  iEvent.put( seedstrip, Prefix + "seedstrip" );
157  iEvent.put( seedindex, Prefix + "seedindex" );
158  iEvent.put( seedcharge, Prefix + "seedcharge" );
159  iEvent.put( seednoise, Prefix + "seednoise" );
160  iEvent.put( seedgain, Prefix + "seedgain" );
161  iEvent.put( qualityisbad, Prefix + "qualityisbad" );
162 
163  iEvent.put( rawchargeC, Prefix + "rawchargeC" );
164  iEvent.put( rawchargeL, Prefix + "rawchargeL" );
165  iEvent.put( rawchargeR, Prefix + "rawchargeR" );
166  iEvent.put( rawchargeLL, Prefix + "rawchargeLL" );
167  iEvent.put( rawchargeRR, Prefix + "rawchargeRR" );
168  iEvent.put( etaX, Prefix + "etaX" );
169  iEvent.put( eta, Prefix + "eta" );
170  iEvent.put( foldedeta, Prefix + "foldedeta" );
171  iEvent.put( etaasymm, Prefix + "etaasymm" );
172  iEvent.put( outsideasymm, Prefix + "outsideasymm" );
173  iEvent.put( neweta, Prefix + "neweta" );
174  iEvent.put( newetaerr, Prefix + "newetaerr" );
175 
176  iEvent.put( detid, Prefix + "detid" );
177  iEvent.put( subdetid, Prefix + "subdetid" );
178  iEvent.put( module, Prefix + "module" );
179  iEvent.put( side, Prefix + "side" );
180  iEvent.put( layerwheel, Prefix + "layerwheel" );
181  iEvent.put( stringringrod, Prefix + "stringringrod" );
182  iEvent.put( petal, Prefix + "petal" );
183  iEvent.put( stereo, Prefix + "stereo" );
184 
185 }
int module() const
Definition: HLTadd.h:12
double charge(const std::vector< uint8_t > &Ampls)
T eta() const
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
Definition: Event.h:84
T sqrt(T t)
Definition: SSEVec.h:28
float barycenter() const
bool isValid() const
Definition: HandleBase.h:76
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:359
id_type detId() const
Definition: DetSetNew.h:72
Definition: vlib.h:209
const std::vector< uint8_t > & amplitudes() const
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().