CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Attributes
ReducedESRecHitCollectionProducer Class Reference

#include <ReducedESRecHitCollectionProducer.h>

Inheritance diagram for ReducedESRecHitCollectionProducer:
edm::EDProducer edm::ProducerBase edm::ProductRegistryHelper

Public Member Functions

void beginRun (edm::Run &, const edm::EventSetup &)
 
void collectIds (const ESDetId strip1, const ESDetId strip2, const int &row=0)
 
void produce (edm::Event &e, const edm::EventSetup &c)
 
 ReducedESRecHitCollectionProducer (const edm::ParameterSet &pset)
 
virtual ~ReducedESRecHitCollectionProducer ()
 
- 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 Attributes

std::set< DetIdcollectedIds_
 
const EcalPreshowerGeometrygeometry_p
 
edm::InputTag InputRecHitES_
 
edm::InputTag InputSpuerClusterEE_
 
std::vector< edm::InputTaginterestingDetIdCollections_
 
std::string OutputLabelES_
 
double scEtThresh_
 
CaloSubdetectorTopologytopology_p
 

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 27 of file ReducedESRecHitCollectionProducer.h.

Constructor & Destructor Documentation

ReducedESRecHitCollectionProducer::ReducedESRecHitCollectionProducer ( const edm::ParameterSet pset)

Definition at line 17 of file ReducedESRecHitCollectionProducer.cc.

References edm::ParameterSet::getParameter(), InputRecHitES_, InputSpuerClusterEE_, interestingDetIdCollections_, OutputLabelES_, and scEtThresh_.

17  :
18  geometry_p(0),
19  topology_p(0)
20 {
21 
22  scEtThresh_ = ps.getParameter<double>("scEtThreshold");
23 
24  InputRecHitES_ = ps.getParameter<edm::InputTag>("EcalRecHitCollectionES");
25  InputSpuerClusterEE_ = ps.getParameter<edm::InputTag>("EndcapSuperClusterCollection");
26 
27  OutputLabelES_ = ps.getParameter<std::string>("OutputLabel_ES");
28 
29  interestingDetIdCollections_ = ps.getParameter<std::vector< edm::InputTag> >("interestingDetIds");
30 
31  produces< EcalRecHitCollection > (OutputLabelES_);
32 
33 }
std::vector< edm::InputTag > interestingDetIdCollections_
ReducedESRecHitCollectionProducer::~ReducedESRecHitCollectionProducer ( )
virtual

Definition at line 35 of file ReducedESRecHitCollectionProducer.cc.

References topology_p.

35  {
36  if (topology_p) delete topology_p;
37 }

Member Function Documentation

void ReducedESRecHitCollectionProducer::beginRun ( edm::Run ,
const edm::EventSetup iSetup 
)
virtual

Reimplemented from edm::EDProducer.

Definition at line 39 of file ReducedESRecHitCollectionProducer.cc.

References DetId::Ecal, EcalPreshower, geometry, geometry_p, edm::EventSetup::get(), and topology_p.

39  {
40  ESHandle<CaloGeometry> geoHandle;
41  iSetup.get<CaloGeometryRecord>().get(geoHandle);
42  const CaloSubdetectorGeometry *geometry = geoHandle->getSubdetectorGeometry(DetId::Ecal, EcalPreshower);
43  geometry_p = dynamic_cast<const EcalPreshowerGeometry *>(geometry);
44  if (!geometry_p){
45  edm::LogError("WrongGeometry")<<
46  "could not cast the subdet geometry to preshower geometry";
47  }
48 
49  if (geometry) topology_p = new EcalPreshowerTopology(geoHandle);
50 
51 }
const T & get() const
Definition: EventSetup.h:55
ESHandle< TrackerGeometry > geometry
void ReducedESRecHitCollectionProducer::collectIds ( const ESDetId  strip1,
const ESDetId  strip2,
const int &  row = 0 
)

Definition at line 121 of file ReducedESRecHitCollectionProducer.cc.

References collectedIds_, CaloNavigator< T >::east(), CaloNavigator< T >::home(), i, CaloNavigator< T >::north(), CaloNavigator< T >::setHome(), CaloNavigator< T >::south(), topology_p, and CaloNavigator< T >::west().

Referenced by produce().

121  {
122 
123  //cout<<row<<endl;
124 
125  map<DetId,const EcalRecHit*>::iterator it;
126  map<DetId, int>::iterator itu;
127  ESDetId next;
128  ESDetId strip1;
129  ESDetId strip2;
130 
131  strip1 = esDetId1;
132  strip2 = esDetId2;
133 
134  EcalPreshowerNavigator theESNav1(strip1, topology_p);
135  theESNav1.setHome(strip1);
136 
137  EcalPreshowerNavigator theESNav2(strip2, topology_p);
138  theESNav2.setHome(strip2);
139 
140  if (row == 1) {
141  if (strip1 != ESDetId(0)) strip1 = theESNav1.north();
142  if (strip2 != ESDetId(0)) strip2 = theESNav2.east();
143  } else if (row == -1) {
144  if (strip1 != ESDetId(0)) strip1 = theESNav1.south();
145  if (strip2 != ESDetId(0)) strip2 = theESNav2.west();
146  }
147 
148  // Plane 1
149  if (strip1 == ESDetId(0)) {
150  } else {
151  collectedIds_.insert(strip1);
152  //cout<<"center : "<<strip1<<endl;
153  // east road
154  for (int i=0; i<15; ++i) {
155  next = theESNav1.east();
156  //cout<<"east : "<<i<<" "<<next<<endl;
157  if (next != ESDetId(0)) {
158  collectedIds_.insert(next);
159  } else {
160  break;
161  }
162  }
163 
164  // west road
165  theESNav1.setHome(strip1);
166  theESNav1.home();
167  for (int i=0; i<15; ++i) {
168  next = theESNav1.west();
169  //cout<<"west : "<<i<<" "<<next<<endl;
170  if (next != ESDetId(0)) {
171  collectedIds_.insert(next);
172  } else {
173  break;
174  }
175  }
176 
177  }
178 
179  if (strip2 == ESDetId(0)) {
180  } else {
181  collectedIds_.insert(strip2);
182  //cout<<"center : "<<strip2<<endl;
183  // north road
184  for (int i=0; i<15; ++i) {
185  next = theESNav2.north();
186  //cout<<"north : "<<i<<" "<<next<<endl;
187  if (next != ESDetId(0)) {
188  collectedIds_.insert(next);
189  } else {
190  break;
191  }
192  }
193 
194  // south road
195  theESNav2.setHome(strip2);
196  theESNav2.home();
197  for (int i=0; i<15; ++i) {
198  next = theESNav2.south();
199  //cout<<"south : "<<i<<" "<<next<<endl;
200  if (next != ESDetId(0)) {
201  collectedIds_.insert(next);
202  } else {
203  break;
204  }
205  }
206  }
207 }
int i
Definition: DBlmapReader.cc:9
void ReducedESRecHitCollectionProducer::produce ( edm::Event e,
const edm::EventSetup c 
)
virtual

Implements edm::EDProducer.

Definition at line 53 of file ReducedESRecHitCollectionProducer.cc.

References collectedIds_, collectIds(), geometry_p, edm::Event::getByLabel(), EcalPreshowerGeometry::getClosestCellInPlane(), InputRecHitES_, InputSpuerClusterEE_, interestingDetIdCollections_, edm::HandleBase::isValid(), convertSQLitetoXML_cfg::output, OutputLabelES_, point, edm::Handle< T >::product(), edm::Event::put(), scEtThresh_, and matplotRender::t.

53  {
54 
55 
57  e.getByLabel(InputRecHitES_, ESRecHits_);
58 
59  std::auto_ptr<EcalRecHitCollection> output(new EcalRecHitCollection);
60 
61  edm::Handle<reco::SuperClusterCollection> pEndcapSuperClusters;
62  e.getByLabel(InputSpuerClusterEE_, pEndcapSuperClusters);
63  {
64  const reco::SuperClusterCollection* eeSuperClusters = pEndcapSuperClusters.product();
65 
66  for (reco::SuperClusterCollection::const_iterator isc = eeSuperClusters->begin(); isc != eeSuperClusters->end(); ++isc) {
67 
68  if (isc->energy() < scEtThresh_) continue;
69  if (fabs(isc->eta()) < 1.65 || fabs(isc->eta()) > 2.6) continue;
70  //cout<<"SC energy : "<<isc->energy()<<" "<<isc->eta()<<endl;
71 
72  //Int_t nBC = 0;
73  reco::CaloCluster_iterator ibc = isc->clustersBegin();
74  for ( ; ibc != isc->clustersEnd(); ++ibc ) {
75 
76  //cout<<"BC : "<<nBC<<endl;
77 
78  const GlobalPoint point((*ibc)->x(),(*ibc)->y(),(*ibc)->z());
79 
82 
83  collectIds(esId1, esId2, 0);
84  collectIds(esId1, esId2, 1);
85  collectIds(esId1, esId2, -1);
86 
87  //nBC++;
88  }
89 
90  }
91 
92  }
93 
94 
96  for( unsigned int t = 0; t < interestingDetIdCollections_.size(); ++t )
97  {
99  if (!detId.isValid()){
100  edm::LogError("MissingInput")<<"the collection of interesting detIds:"<<interestingDetIdCollections_[t]<<" is not found.";
101  continue;
102  }
103  collectedIds_.insert(detId->begin(),detId->end());
104  }
105 
106 
107  output->reserve( collectedIds_.size());
109  for (it = ESRecHits_->begin(); it != ESRecHits_->end(); ++it) {
110  if (it->recoFlag()==1 || it->recoFlag()==14 || (it->recoFlag()<=10 && it->recoFlag()>=5)) continue;
111  if (collectedIds_.find(it->id())!=collectedIds_.end()){
112  output->push_back(*it);
113  }
114  }
115  collectedIds_.clear();
116 
118 
119 }
std::vector< T >::const_iterator const_iterator
void collectIds(const ESDetId strip1, const ESDetId strip2, const int &row=0)
std::vector< SuperCluster > SuperClusterCollection
collection of SuperCluser objectr
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
Definition: Event.h:84
virtual DetId getClosestCellInPlane(const GlobalPoint &r, int plane) const
bool isValid() const
Definition: HandleBase.h:76
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:355
std::vector< edm::InputTag > interestingDetIdCollections_
T const * product() const
Definition: Handle.h:74
*vegas h *****************************************************used in the default bin number in original ***version of VEGAS is ***a higher bin number might help to derive a more precise ***grade subtle point
Definition: invegas.h:5

Member Data Documentation

std::set<DetId> ReducedESRecHitCollectionProducer::collectedIds_
private

Definition at line 49 of file ReducedESRecHitCollectionProducer.h.

Referenced by collectIds(), and produce().

const EcalPreshowerGeometry* ReducedESRecHitCollectionProducer::geometry_p
private

Definition at line 39 of file ReducedESRecHitCollectionProducer.h.

Referenced by beginRun(), and produce().

edm::InputTag ReducedESRecHitCollectionProducer::InputRecHitES_
private
edm::InputTag ReducedESRecHitCollectionProducer::InputSpuerClusterEE_
private
std::vector<edm::InputTag> ReducedESRecHitCollectionProducer::interestingDetIdCollections_
private
std::string ReducedESRecHitCollectionProducer::OutputLabelES_
private
double ReducedESRecHitCollectionProducer::scEtThresh_
private
CaloSubdetectorTopology* ReducedESRecHitCollectionProducer::topology_p
private