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

Public Member Functions

 CastorCellProducer (const edm::ParameterSet &)
 
 ~CastorCellProducer ()
 
- Public Member Functions inherited from edm::EDProducer
 EDProducer ()
 
ModuleDescription const & moduleDescription () const
 
virtual ~EDProducer ()
 
- Public Member Functions inherited from edm::ProducerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 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 (std::string const &iProcessName, std::string const &iModuleLabel, bool iPrint, std::vector< char const * > &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 Types

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

Private Member Functions

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

Private Attributes

edm::EDGetTokenT
< CastorRecHitCollection
tok_input_
 

Additional Inherited Members

- Public Types inherited from edm::EDProducer
typedef EDProducer ModuleType
 
- Public Types inherited from edm::ProducerBase
typedef
ProductRegistryHelper::TypeLabelList 
TypeLabelList
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- 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::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

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

Definition at line 44 of file CastorCellProducer.cc.

Member Typedef Documentation

Definition at line 57 of file CastorCellProducer.cc.

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

Definition at line 56 of file CastorCellProducer.cc.

Definition at line 55 of file CastorCellProducer.cc.

Constructor & Destructor Documentation

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

Definition at line 75 of file CastorCellProducer.cc.

References edm::ParameterSet::getUntrackedParameter(), HLT_25ns10e33_v2_cff::InputTag, AlCaHLTBitMon_QueryRunRegistry::string, and tok_input_.

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

Definition at line 84 of file CastorCellProducer.cc.

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

Member Function Documentation

void CastorCellProducer::beginJob ( void  )
overrideprivatevirtual

Reimplemented from edm::EDProducer.

Definition at line 179 of file CastorCellProducer.cc.

References LogDebug.

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

Reimplemented from edm::EDProducer.

Definition at line 185 of file CastorCellProducer.cc.

References LogDebug.

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

Implements edm::EDProducer.

Definition at line 97 of file CastorCellProducer.cc.

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

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

Member Data Documentation

edm::EDGetTokenT<CastorRecHitCollection> CastorCellProducer::tok_input_
private

Definition at line 58 of file CastorCellProducer.cc.

Referenced by CastorCellProducer(), and produce().