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 Types | Private Member Functions | Private Attributes
CastorCellProducer Class Reference

#include <RecoLocalCalo/Castor/src/CastorCellProducer.cc>

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

Public Member Functions

 CastorCellProducer (const edm::ParameterSet &)
 
 ~CastorCellProducer ()
 
- 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 Types

typedef std::vector
< reco::CastorCell
CastorCellCollection
 
typedef ROOT::Math::RhoZPhiPoint CellPoint
 
typedef math::XYZPointD Point
 

Private Member Functions

virtual void beginJob ()
 
virtual void endJob ()
 
virtual void produce (edm::Event &, const edm::EventSetup &)
 

Private Attributes

std::string input_
 

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

Description: CastorCell Reconstruction Producer. Produce CastorCells from CastorRecHits. Implementation:

Definition at line 45 of file CastorCellProducer.cc.

Member Typedef Documentation

Definition at line 58 of file CastorCellProducer.cc.

typedef ROOT::Math::RhoZPhiPoint CastorCellProducer::CellPoint
private

Definition at line 57 of file CastorCellProducer.cc.

Definition at line 56 of file CastorCellProducer.cc.

Constructor & Destructor Documentation

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

Definition at line 76 of file CastorCellProducer.cc.

76  :
77  input_(iConfig.getUntrackedParameter<std::string>("inputprocess","castorreco"))
78 {
79  // register your products
80  produces<CastorCellCollection>();
81  // now do what ever other initialization is needed
82 }
T getUntrackedParameter(std::string const &, T const &) const
CastorCellProducer::~CastorCellProducer ( )

Definition at line 85 of file CastorCellProducer.cc.

86 {
87  // do anything here that needs to be done at desctruction time
88  // (e.g. close files, deallocate resources etc.)
89 }

Member Function Documentation

void CastorCellProducer::beginJob ( void  )
privatevirtual

Reimplemented from edm::EDProducer.

Definition at line 180 of file CastorCellProducer.cc.

References LogDebug.

180  {
181  LogDebug("CastorCellProducer")
182  <<"Starting CastorCellProducer";
183 }
#define LogDebug(id)
void CastorCellProducer::endJob ( void  )
privatevirtual

Reimplemented from edm::EDProducer.

Definition at line 186 of file CastorCellProducer.cc.

References LogDebug.

186  {
187  LogDebug("CastorCellProducer")
188  <<"Ending CastorCellProducer";
189 }
#define LogDebug(id)
void CastorCellProducer::produce ( edm::Event iEvent,
const edm::EventSetup iSetup 
)
privatevirtual

Implements edm::EDProducer.

Definition at line 98 of file CastorCellProducer.cc.

References CaloRecHit::energy(), relval_parameters_module::energy, edm::Event::getByLabel(), i, CastorRecHit::id(), input_, j, LogDebug, HcalCastorDetId::module(), MYR2D, edm::Event::put(), dt_dqm_sourceclient_common_cff::reco, HcalCastorDetId::sector(), and HcalCastorDetId::zside().

98  {
99 
100  using namespace edm;
101  using namespace reco;
102  using namespace TMath;
103 
104  // Produce CastorCells from CastorRecHits
105 
107  iEvent.getByLabel(input_, InputRecHits);
108 
109  std::auto_ptr<CastorCellCollection> OutputCells (new CastorCellCollection);
110 
111  // looping over all CastorRecHits
112 
113  LogDebug("CastorCellProducer")
114  <<"1. entering CastorCellProducer ";
115 
116  for (size_t i = 0; i < InputRecHits->size(); ++i) {
117  const CastorRecHit & rh = (*InputRecHits)[i];
118  int sector = rh.id().sector();
119  int module = rh.id().module();
120  double energy = rh.energy();
121  int zside = rh.id().zside();
122 
123  // define CastorCell properties
124  double zCell=0.;
125  double phiCell;
126  double rhoCell;
127 
128  // set z position of the cell
129  if (module < 3) {
130  // starting in EM section
131  if (module == 1) zCell = 14415;
132  if (module == 2) zCell = 14464;
133  } else {
134  // starting in HAD section
135  zCell = 14534 + (module - 3)*92;
136  }
137 
138  // set phi position of the cell
139  double castorphi[16];
140  for (int j = 0; j < 16; j++) {
141  castorphi[j] = -2.94524 + j*0.3927;
142  }
143  if (sector > 8) {
144  phiCell = castorphi[sector - 9];
145  } else {
146  phiCell = castorphi[sector + 7];
147  }
148 
149  // add condition to select in eta sides
150  if (zside <= 0) zCell = -1*zCell;
151 
152  // set rho position of the cell (inner radius 3.7cm, outer radius 14cm)
153  rhoCell = 88.5;
154 
155  // store cell position
156  CellPoint tempcellposition(rhoCell,zCell,phiCell);
157  Point cellposition(tempcellposition);
158 
159  LogDebug("CastorCellProducer")
160  <<"cell number: "<<i+1<<std::endl
161  <<"rho: "<<cellposition.rho()<<" phi: "<<cellposition.phi()*MYR2D<<" eta: "<<cellposition.eta()<<std::endl
162  <<"x: "<<cellposition.x()<<" y: "<<cellposition.y()<<" z: "<<cellposition.z();
163 
164  if (energy > 0.) {
165  CastorCell newCell(energy,cellposition);
166  OutputCells->push_back(newCell);
167  }
168 
169  } // end loop over CastorRecHits
170 
171  LogDebug("CastorCellProducer")
172  <<"total number of cells in the event: "<<InputRecHits->size();
173 
174  iEvent.put(OutputCells);
175 
176 
177 }
#define LogDebug(id)
int i
Definition: DBlmapReader.cc:9
int sector() const
get the sector (1-16)
int module() const
get the module (1-2 for EM, 1-12 for HAD)
HcalCastorDetId id() const
get the id
Definition: CastorRecHit.h:15
std::vector< CastorCell > CastorCellCollection
collection of CastorCell objects
Definition: CastorCell.h:81
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
Definition: Event.h:85
float energy() const
Definition: CaloRecHit.h:19
math::XYZPoint Point
int zside() const
get the z-side of the cell (1/-1)
int j
Definition: DBlmapReader.cc:9
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:356
const double MYR2D
Definition: vlib.h:209
ROOT::Math::RhoZPhiPoint CellPoint

Member Data Documentation

std::string CastorCellProducer::input_
private

Definition at line 59 of file CastorCellProducer.cc.

Referenced by produce().