CMS 3D CMS Logo

Public Member Functions | Private Member Functions | Private Attributes

PFHCALDualTimeRecHitProducer Class Reference

Producer for particle flow rechits (PFRecHit) in HCAL Upgrade. More...

#include <PFHCALDualTimeRecHitProducer.h>

Inheritance diagram for PFHCALDualTimeRecHitProducer:
PFRecHitProducer edm::EDProducer edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

List of all members.

Public Member Functions

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

Private Member Functions

reco::PFRecHitcreateHcalRecHit (const DetId &detid, double energy, PFLayer::Layer layer, const CaloSubdetectorGeometry *geom, unsigned newDetId=0)
void createRecHits (std::vector< reco::PFRecHit > &rechits, std::vector< reco::PFRecHit > &rechitsCleaned, edm::Event &, const edm::EventSetup &)
void findRecHitNeighbours (reco::PFRecHit &rh, const std::map< unsigned, unsigned > &sortedHits, const CaloSubdetectorTopology &barrelTopo, const CaloSubdetectorGeometry &barrelGeom, const CaloSubdetectorTopology &endcapTopo, const CaloSubdetectorGeometry &endcapGeom)
void findRecHitNeighboursCT (reco::PFRecHit &rh, const std::map< unsigned, unsigned > &sortedHits, const CaloSubdetectorTopology &topology)
DetId getNorth (const DetId &id, const CaloSubdetectorTopology &topology)
DetId getSouth (const DetId &id, const CaloSubdetectorTopology &topology)

Private Attributes

bool applyLongShortDPG_
bool applyPulseDPG_
bool applyTimeDPG_
bool ECAL_Compensate_
double ECAL_Compensation_
unsigned int ECAL_Dead_Code_
double ECAL_Threshold_
double EM_Depth_
double HAD_Depth_
bool HCAL_Calib_
float HCAL_Calib_29
bool HF_Calib_
float HF_Calib_29
edm::InputTag inputTagCaloTowers_
edm::InputTag inputTagHcalRecHitsHBHE_
edm::InputTag inputTagHcalRecHitsHF_
double longFibre_Cut
double longFibre_Fraction
double longShortFibre_Cut
double maxLongTiming_Cut
double maxShortTiming_Cut
double minLongTiming_Cut
double minShortTiming_Cut
bool navigation_HF_
double shortFibre_Cut
double shortFibre_Fraction
double thresh_HF_
 threshold for HF
double weight_HFem_
double weight_HFhad_

Detailed Description

Producer for particle flow rechits (PFRecHit) in HCAL Upgrade.

Author:
Chris Tully
Date:
June 2012

Definition at line 33 of file PFHCALDualTimeRecHitProducer.h.


Constructor & Destructor Documentation

PFHCALDualTimeRecHitProducer::PFHCALDualTimeRecHitProducer ( const edm::ParameterSet iConfig) [explicit]

Definition at line 41 of file PFHCALDualTimeRecHitProducer.cc.

References applyLongShortDPG_, applyPulseDPG_, applyTimeDPG_, ECAL_Compensate_, ECAL_Compensation_, ECAL_Dead_Code_, ECAL_Threshold_, EM_Depth_, edm::ParameterSet::getParameter(), HAD_Depth_, HCAL_Calib_, HCAL_Calib_29, HF_Calib_, HF_Calib_29, inputTagCaloTowers_, inputTagHcalRecHitsHBHE_, inputTagHcalRecHitsHF_, longFibre_Cut, longFibre_Fraction, longShortFibre_Cut, maxLongTiming_Cut, maxShortTiming_Cut, minLongTiming_Cut, minShortTiming_Cut, navigation_HF_, shortFibre_Cut, shortFibre_Fraction, thresh_HF_, weight_HFem_, and weight_HFhad_.

  : PFRecHitProducer( iConfig ) 
{

 

  // access to the collections of rechits 

  
  inputTagHcalRecHitsHBHE_ =
    iConfig.getParameter<InputTag>("hcalRecHitsHBHE");
    
  inputTagHcalRecHitsHF_ =
    iConfig.getParameter<InputTag>("hcalRecHitsHF");
    
 
  inputTagCaloTowers_ = 
    iConfig.getParameter<InputTag>("caloTowers");
   
  thresh_HF_ = 
    iConfig.getParameter<double>("thresh_HF");
  navigation_HF_ = 
    iConfig.getParameter<bool>("navigation_HF");
  weight_HFem_ =
    iConfig.getParameter<double>("weight_HFem");
  weight_HFhad_ =
    iConfig.getParameter<double>("weight_HFhad");

  HCAL_Calib_ =
    iConfig.getParameter<bool>("HCAL_Calib");
  HF_Calib_ =
    iConfig.getParameter<bool>("HF_Calib");
  HCAL_Calib_29 = 
    iConfig.getParameter<double>("HCAL_Calib_29");
  HF_Calib_29 = 
    iConfig.getParameter<double>("HF_Calib_29");

  shortFibre_Cut = iConfig.getParameter<double>("ShortFibre_Cut");
  longFibre_Fraction = iConfig.getParameter<double>("LongFibre_Fraction");

  longFibre_Cut = iConfig.getParameter<double>("LongFibre_Cut");
  shortFibre_Fraction = iConfig.getParameter<double>("ShortFibre_Fraction");

  applyLongShortDPG_ = iConfig.getParameter<bool>("ApplyLongShortDPG");

  longShortFibre_Cut = iConfig.getParameter<double>("LongShortFibre_Cut");
  minShortTiming_Cut = iConfig.getParameter<double>("MinShortTiming_Cut");
  maxShortTiming_Cut = iConfig.getParameter<double>("MaxShortTiming_Cut");
  minLongTiming_Cut = iConfig.getParameter<double>("MinLongTiming_Cut");
  maxLongTiming_Cut = iConfig.getParameter<double>("MaxLongTiming_Cut");

  applyTimeDPG_ = iConfig.getParameter<bool>("ApplyTimeDPG");
  applyPulseDPG_ = iConfig.getParameter<bool>("ApplyPulseDPG");

  ECAL_Compensate_ = iConfig.getParameter<bool>("ECAL_Compensate");
  ECAL_Threshold_ = iConfig.getParameter<double>("ECAL_Threshold");
  ECAL_Compensation_ = iConfig.getParameter<double>("ECAL_Compensation");
  ECAL_Dead_Code_ = iConfig.getParameter<unsigned int>("ECAL_Dead_Code");

  EM_Depth_ = iConfig.getParameter<double>("EM_Depth");
  HAD_Depth_ = iConfig.getParameter<double>("HAD_Depth");

  //--ab
  produces<reco::PFRecHitCollection>("HFHAD").setBranchAlias("HFHADRecHits");
  produces<reco::PFRecHitCollection>("HFEM").setBranchAlias("HFEMRecHits");
  //--ab
}
PFHCALDualTimeRecHitProducer::~PFHCALDualTimeRecHitProducer ( )

Definition at line 111 of file PFHCALDualTimeRecHitProducer.cc.

{}

Member Function Documentation

reco::PFRecHit * PFHCALDualTimeRecHitProducer::createHcalRecHit ( const DetId detid,
double  energy,
PFLayer::Layer  layer,
const CaloSubdetectorGeometry geom,
unsigned  newDetId = 0 
) [private]

Definition at line 1125 of file PFHCALDualTimeRecHitProducer.cc.

References cond::rpcobgas::detid, EM_Depth_, CaloCellGeometry::getCorners(), CaloSubdetectorGeometry::getGeometry(), CaloCellGeometry::getPosition(), HAD_Depth_, PFLayer::HF_EM, PFLayer::HF_HAD, position, DetId::rawId(), reco::PFRecHit::setNECorner(), reco::PFRecHit::setNWCorner(), reco::PFRecHit::setSECorner(), reco::PFRecHit::setSWCorner(), PV3DBase< T, PVType, FrameType >::x(), x, PV3DBase< T, PVType, FrameType >::y(), detailsBasic3DVector::y, PV3DBase< T, PVType, FrameType >::z(), and z.

Referenced by PFRecHitProducerPS::createRecHits().

                                                            {
  
  const CaloCellGeometry *thisCell = geom->getGeometry(detid);
  if(!thisCell) {
    edm::LogError("PFHCALDualTimeRecHitProducer")
      <<"warning detid "<<detid.rawId()<<" not found in layer "
      <<layer<<endl;
    return 0;
  }
  
  const GlobalPoint& position = thisCell->getPosition();
  
  double depth_correction = 0.;
  switch ( layer ) { 
  case PFLayer::HF_EM:
    depth_correction = position.z() > 0. ? EM_Depth_ : -EM_Depth_;
    break;
  case PFLayer::HF_HAD:
    depth_correction = position.z() > 0. ? HAD_Depth_ : -HAD_Depth_;
    break;
  default:
    break;
  }

  unsigned id = detid;
  if(newDetId) id = newDetId;
  reco::PFRecHit *rh = 
    new reco::PFRecHit( id,  layer, energy, 
                        position.x(), position.y(), position.z()+depth_correction, 
                        0,0,0 );
 
  
  
  
  // set the corners
  const CaloCellGeometry::CornersVec& corners = thisCell->getCorners();

  assert( corners.size() == 8 );

  rh->setNECorner( corners[0].x(), corners[0].y(),  corners[0].z()+depth_correction );
  rh->setSECorner( corners[1].x(), corners[1].y(),  corners[1].z()+depth_correction );
  rh->setSWCorner( corners[2].x(), corners[2].y(),  corners[2].z()+depth_correction );
  rh->setNWCorner( corners[3].x(), corners[3].y(),  corners[3].z()+depth_correction );
 
  return rh;
}
void PFHCALDualTimeRecHitProducer::createRecHits ( std::vector< reco::PFRecHit > &  rechits,
std::vector< reco::PFRecHit > &  rechitsCleaned,
edm::Event ,
const edm::EventSetup  
) [private, virtual]

gets hcal barrel and endcap rechits, translate them to PFRecHits, which are stored in the rechits vector

Implements PFRecHitProducer.

void PFHCALDualTimeRecHitProducer::findRecHitNeighbours ( reco::PFRecHit rh,
const std::map< unsigned, unsigned > &  sortedHits,
const CaloSubdetectorTopology barrelTopo,
const CaloSubdetectorGeometry barrelGeom,
const CaloSubdetectorTopology endcapTopo,
const CaloSubdetectorGeometry endcapGeom 
) [private]

find and set the neighbours to a given rechit this works for ecal, hcal, ps

Referenced by PFRecHitProducerPS::createRecHits().

void PFHCALDualTimeRecHitProducer::findRecHitNeighboursCT ( reco::PFRecHit rh,
const std::map< unsigned, unsigned > &  sortedHits,
const CaloSubdetectorTopology topology 
) [private]

find and set the neighbours to a given rechit this works for hcal CaloTowers. Should be possible to have a single function for all detectors

Referenced by PFRecHitProducerPS::createRecHits().

DetId PFHCALDualTimeRecHitProducer::getNorth ( const DetId id,
const CaloSubdetectorTopology topology 
) [private]

Definition at line 1508 of file PFHCALDualTimeRecHitProducer.cc.

References north, and CaloSubdetectorTopology::north().

                                                                        {

  DetId north;
  vector<DetId> nids = topology.north(id);
  if(nids.size() == 1)
    north = nids[0];
  
  return north;
} 
DetId PFHCALDualTimeRecHitProducer::getSouth ( const DetId id,
const CaloSubdetectorTopology topology 
) [private]

Definition at line 1494 of file PFHCALDualTimeRecHitProducer.cc.

References south, and CaloSubdetectorTopology::south().

                                                                        {

  DetId south;
  vector<DetId> sids = topology.south(id);
  if(sids.size() == 1)
    south = sids[0];
  
  return south;
} 

Member Data Documentation

Definition at line 125 of file PFHCALDualTimeRecHitProducer.h.

Referenced by PFHCALDualTimeRecHitProducer().

Definition at line 91 of file PFHCALDualTimeRecHitProducer.h.

Referenced by PFHCALDualTimeRecHitProducer().

threshold for HF

Definition at line 89 of file PFHCALDualTimeRecHitProducer.h.

Referenced by PFRecHitProducerPS::createRecHits(), and PFHCALDualTimeRecHitProducer().