CMS 3D CMS Logo

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

List of all members.

Public Member Functions

 CastorCellProducer (const edm::ParameterSet &)
 ~CastorCellProducer ()

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_

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.

                                                                     :
  input_(iConfig.getUntrackedParameter<std::string>("inputprocess","castorreco"))
{
  // register your products
  produces<CastorCellCollection>();
  // now do what ever other initialization is needed
}
CastorCellProducer::~CastorCellProducer ( )

Definition at line 85 of file CastorCellProducer.cc.

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

Member Function Documentation

void CastorCellProducer::beginJob ( void  ) [private, virtual]

Reimplemented from edm::EDProducer.

Definition at line 180 of file CastorCellProducer.cc.

References LogDebug.

                                  {
  LogDebug("CastorCellProducer")
    <<"Starting CastorCellProducer";
}
void CastorCellProducer::endJob ( void  ) [private, virtual]

Reimplemented from edm::EDProducer.

Definition at line 186 of file CastorCellProducer.cc.

References LogDebug.

                                {
  LogDebug("CastorCellProducer")
    <<"Ending CastorCellProducer";
}
void CastorCellProducer::produce ( edm::Event iEvent,
const edm::EventSetup iSetup 
) [private, virtual]

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().

                                                                              {

  using namespace edm;
  using namespace reco;
  using namespace TMath;
  
  // Produce CastorCells from CastorRecHits

  edm::Handle<CastorRecHitCollection> InputRecHits;
  iEvent.getByLabel(input_, InputRecHits);
    
  std::auto_ptr<CastorCellCollection> OutputCells (new CastorCellCollection);
   
  // looping over all CastorRecHits

  LogDebug("CastorCellProducer")
    <<"1. entering CastorCellProducer ";

  for (size_t i = 0; i < InputRecHits->size(); ++i) {
    const CastorRecHit & rh = (*InputRecHits)[i];
    int sector = rh.id().sector();
    int module = rh.id().module();
    double energy = rh.energy();
    int zside = rh.id().zside();
    
    // define CastorCell properties
    double zCell=0.;
    double phiCell;
    double rhoCell;
      
    // set z position of the cell
    if (module < 3) {
      // starting in EM section
      if (module == 1) zCell = 14415;
      if (module == 2) zCell = 14464; 
    } else {
      // starting in HAD section
      zCell = 14534 + (module - 3)*92;
    }
      
    // set phi position of the cell
    double castorphi[16];
    for (int j = 0; j < 16; j++) {
      castorphi[j] = -2.94524 + j*0.3927;
    }
    if (sector > 8) {
      phiCell = castorphi[sector - 9];
    } else {
      phiCell = castorphi[sector + 7];
    }
      
    // add condition to select in eta sides
    if (zside <= 0) zCell = -1*zCell;
      
    // set rho position of the cell (inner radius 3.7cm, outer radius 14cm)
    rhoCell = 88.5;
    
    // store cell position
    CellPoint tempcellposition(rhoCell,zCell,phiCell);
    Point cellposition(tempcellposition);
    
    LogDebug("CastorCellProducer")
      <<"cell number: "<<i+1<<std::endl
      <<"rho: "<<cellposition.rho()<<" phi: "<<cellposition.phi()*MYR2D<<" eta: "<<cellposition.eta()<<std::endl
      <<"x: "<<cellposition.x()<<" y: "<<cellposition.y()<<" z: "<<cellposition.z();
    
    if (energy > 0.) {
      CastorCell newCell(energy,cellposition);
      OutputCells->push_back(newCell);
    }
      
  } // end loop over CastorRecHits 
    
  LogDebug("CastorCellProducer")
    <<"total number of cells in the event: "<<InputRecHits->size();

  iEvent.put(OutputCells);


}

Member Data Documentation

std::string CastorCellProducer::input_ [private]

Definition at line 59 of file CastorCellProducer.cc.

Referenced by produce().