CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Protected Attributes
PFCTRecHitProducer Class Referencefinal

#include <PFCTRecHitProducer.h>

Inheritance diagram for PFCTRecHitProducer:
edm::stream::EDProducer<> edm::stream::EDProducerBase edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Member Functions

virtual void beginLuminosityBlock (const edm::LuminosityBlock &lumi, const edm::EventSetup &es) override
 
reco::PFRecHitcreateHcalRecHit (const DetId &detid, double energy, PFLayer::Layer layer, const CaloSubdetectorGeometry *geom, const CaloTowerDetId &newDetId)
 
 PFCTRecHitProducer (const edm::ParameterSet &)
 
void produce (edm::Event &iEvent, const edm::EventSetup &iSetup)
 
 ~PFCTRecHitProducer ()
 
- Public Member Functions inherited from edm::stream::EDProducer<>
 EDProducer ()=default
 
- Public Member Functions inherited from edm::stream::EDProducerBase
 EDProducerBase ()
 
ModuleDescription const & moduleDescription () const
 
virtual ~EDProducerBase ()
 
- 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 (const std::string &iProcessName, std::vector< const char * > &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 ()
 

Protected 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
 
int hcalHFDigiTimeFlagValue_
 
int hcalHFInTimeWindowFlagValue_
 
int hcalHFLongShortFlagValue_
 
int HcalMaxAllowedChannelStatusSev_
 
int HcalMaxAllowedHFDigiTimeSev_
 
int HcalMaxAllowedHFInTimeWindowSev_
 
int HcalMaxAllowedHFLongShortSev_
 
edm::EDGetTokenT
< HBHERecHitCollection
hcalToken_
 
bool HF_Calib_
 
float HF_Calib_29
 
edm::EDGetTokenT
< HFRecHitCollection
hfToken_
 
double longFibre_Cut
 
double longFibre_Fraction
 
double longShortFibre_Cut
 
int m_maxDepthHB
 
int m_maxDepthHE
 
double maxLongTiming_Cut
 
double maxShortTiming_Cut
 
double minLongTiming_Cut
 
double minShortTiming_Cut
 
bool navigation_HF_
 
PFRecHitNavigatorBasenavigator_
 
double shortFibre_Cut
 
double shortFibre_Fraction
 
const EcalChannelStatustheEcalChStatus
 
const HcalChannelQualitytheHcalChStatus
 
const CaloTowerConstituentsMaptheTowerConstituentsMap
 
double thresh_Barrel_
 
double thresh_Endcap_
 
double thresh_HF_
 threshold for HF More...
 
edm::EDGetTokenT
< CaloTowerCollection
towersToken_
 
double weight_HFem_
 
double weight_HFhad_
 

Additional Inherited Members

- Public Types inherited from edm::stream::EDProducer<>
typedef CacheContexts< T...> CacheTypes
 
typedef CacheTypes::GlobalCache GlobalCache
 
typedef AbilityChecker< T...> HasAbility
 
typedef
CacheTypes::LuminosityBlockCache 
LuminosityBlockCache
 
typedef
LuminosityBlockContextT
< LuminosityBlockCache,
RunCache, GlobalCache
LuminosityBlockContext
 
typedef
CacheTypes::LuminosityBlockSummaryCache 
LuminosityBlockSummaryCache
 
typedef CacheTypes::RunCache RunCache
 
typedef RunContextT< RunCache,
GlobalCache
RunContext
 
typedef CacheTypes::RunSummaryCache RunSummaryCache
 
- Public Types inherited from edm::stream::EDProducerBase
typedef EDProducerAdaptorBase 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::stream::EDProducerBase
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

Definition at line 35 of file PFCTRecHitProducer.h.

Constructor & Destructor Documentation

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

Definition at line 44 of file PFCTRecHitProducer.cc.

References reco::get(), edm::ParameterSet::getParameter(), HLT_25ns14e33_v1_cff::HCAL_Calib_29, HLT_25ns14e33_v1_cff::HF_Calib_29, HcalCaloFlagLabels::HFDigiTime, HcalCaloFlagLabels::HFInTimeWindow, HcalCaloFlagLabels::HFLongShort, and AlCaHLTBitMon_QueryRunRegistry::string.

45 {
47  iConfig.getParameter<double>("thresh_Barrel");
49  iConfig.getParameter<double>("thresh_Endcap");
50 
51 
52  thresh_HF_ =
53  iConfig.getParameter<double>("thresh_HF");
55  iConfig.getParameter<bool>("navigation_HF");
56  weight_HFem_ =
57  iConfig.getParameter<double>("weight_HFem");
59  iConfig.getParameter<double>("weight_HFhad");
60 
61  HCAL_Calib_ =
62  iConfig.getParameter<bool>("HCAL_Calib");
63  HF_Calib_ =
64  iConfig.getParameter<bool>("HF_Calib");
65  HCAL_Calib_29 =
66  iConfig.getParameter<double>("HCAL_Calib_29");
67  HF_Calib_29 =
68  iConfig.getParameter<double>("HF_Calib_29");
69 
70  shortFibre_Cut = iConfig.getParameter<double>("ShortFibre_Cut");
71  longFibre_Fraction = iConfig.getParameter<double>("LongFibre_Fraction");
72 
73  longFibre_Cut = iConfig.getParameter<double>("LongFibre_Cut");
74  shortFibre_Fraction = iConfig.getParameter<double>("ShortFibre_Fraction");
75 
76  applyLongShortDPG_ = iConfig.getParameter<bool>("ApplyLongShortDPG");
77 
78  longShortFibre_Cut = iConfig.getParameter<double>("LongShortFibre_Cut");
79  minShortTiming_Cut = iConfig.getParameter<double>("MinShortTiming_Cut");
80  maxShortTiming_Cut = iConfig.getParameter<double>("MaxShortTiming_Cut");
81  minLongTiming_Cut = iConfig.getParameter<double>("MinLongTiming_Cut");
82  maxLongTiming_Cut = iConfig.getParameter<double>("MaxLongTiming_Cut");
83 
84  applyTimeDPG_ = iConfig.getParameter<bool>("ApplyTimeDPG");
85  applyPulseDPG_ = iConfig.getParameter<bool>("ApplyPulseDPG");
86  HcalMaxAllowedHFLongShortSev_ = iConfig.getParameter<int>("HcalMaxAllowedHFLongShortSev");
87  HcalMaxAllowedHFDigiTimeSev_ = iConfig.getParameter<int>("HcalMaxAllowedHFDigiTimeSev");
88  HcalMaxAllowedHFInTimeWindowSev_ = iConfig.getParameter<int>("HcalMaxAllowedHFInTimeWindowSev");
89  HcalMaxAllowedChannelStatusSev_ = iConfig.getParameter<int>("HcalMaxAllowedChannelStatusSev");
90 
91  ECAL_Compensate_ = iConfig.getParameter<bool>("ECAL_Compensate");
92  ECAL_Threshold_ = iConfig.getParameter<double>("ECAL_Threshold");
93  ECAL_Compensation_ = iConfig.getParameter<double>("ECAL_Compensation");
94  ECAL_Dead_Code_ = iConfig.getParameter<unsigned int>("ECAL_Dead_Code");
95 
96  EM_Depth_ = iConfig.getParameter<double>("EM_Depth");
97  HAD_Depth_ = iConfig.getParameter<double>("HAD_Depth");
98 
99  //Get integer values of individual HCAL HF flags
103 
104  hcalToken_ = consumes<HBHERecHitCollection>(iConfig.getParameter<InputTag>("hcalRecHitsHBHE"));
105  hfToken_ = consumes<HFRecHitCollection>(iConfig.getParameter<InputTag>("hcalRecHitsHF"));
106  towersToken_ = consumes<CaloTowerCollection>(iConfig.getParameter<InputTag>("caloTowers"));
107 
108 
109  edm::ParameterSet navSet = iConfig.getParameter<edm::ParameterSet>("navigator");
110  navigator_ = PFRecHitNavigationFactory::get()->create(navSet.getParameter<std::string>("name"),navSet);
111 
112  //--ab
113  produces<reco::PFRecHitCollection>();
114  produces<reco::PFRecHitCollection>("Cleaned");
115  produces<reco::PFRecHitCollection>("HFHAD").setBranchAlias("HFHADRecHits");
116  produces<reco::PFRecHitCollection>("HFEM").setBranchAlias("HFEMRecHits");
117  //--ab
118 
119 }
T getParameter(std::string const &) const
PFRecHitNavigatorBase * navigator_
unsigned int ECAL_Dead_Code_
double thresh_HF_
threshold for HF
edm::EDGetTokenT< HBHERecHitCollection > hcalToken_
edm::EDGetTokenT< CaloTowerCollection > towersToken_
edm::EDGetTokenT< HFRecHitCollection > hfToken_
T get(const Candidate &c)
Definition: component.h:55
PFCTRecHitProducer::~PFCTRecHitProducer ( )

Definition at line 821 of file PFCTRecHitProducer.cc.

821 {}

Member Function Documentation

void PFCTRecHitProducer::beginLuminosityBlock ( const edm::LuminosityBlock lumi,
const edm::EventSetup es 
)
overridevirtual

Reimplemented from edm::stream::EDProducerBase.

Definition at line 825 of file PFCTRecHitProducer.cc.

References edm::EventSetup::get(), and edm::ESHandle< class >::product().

826  {
827 
828  // Get cleaned channels in the HCAL and HF
829  // HCAL channel status map ****************************************
830  edm::ESHandle<HcalChannelQuality> hcalChStatus;
831  es.get<HcalChannelQualityRcd>().get( "withTopo", hcalChStatus );
832  theHcalChStatus = hcalChStatus.product();
833 
834  // Retrieve the good/bad ECAL channels from the DB
836  es.get<EcalChannelStatusRcd>().get(ecalChStatus);
837  theEcalChStatus = ecalChStatus.product();
838 
840  es.get<CaloGeometryRecord>().get(cttopo);
841  theTowerConstituentsMap = cttopo.product();
842 }
const HcalChannelQuality * theHcalChStatus
const CaloTowerConstituentsMap * theTowerConstituentsMap
const T & get() const
Definition: EventSetup.h:56
T const * product() const
Definition: ESHandle.h:86
const EcalChannelStatus * theEcalChStatus
reco::PFRecHit * PFCTRecHitProducer::createHcalRecHit ( const DetId detid,
double  energy,
PFLayer::Layer  layer,
const CaloSubdetectorGeometry geom,
const CaloTowerDetId newDetId 
)

Definition at line 846 of file PFCTRecHitProducer.cc.

References relval_parameters_module::energy, CaloCellGeometry::getCorners(), CaloSubdetectorGeometry::getGeometry(), CaloCellGeometry::getPosition(), 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(), and PV3DBase< T, PVType, FrameType >::z().

850  {
851 
852  const CaloCellGeometry *thisCell = geom->getGeometry(detid);
853  if(!thisCell) {
854  edm::LogError("PFRecHitProducerHCAL")
855  <<"warning detid "<<detid.rawId()<<" not found in layer "
856  <<layer<<endl;
857  return 0;
858  }
859 
860  const GlobalPoint& position = thisCell->getPosition();
861 
862  double depth_correction = 0.;
863  switch ( layer ) {
864  case PFLayer::HF_EM:
865  depth_correction = position.z() > 0. ? EM_Depth_ : -EM_Depth_;
866  break;
867  case PFLayer::HF_HAD:
868  depth_correction = position.z() > 0. ? HAD_Depth_ : -HAD_Depth_;
869  break;
870  default:
871  break;
872  }
873 
874  reco::PFRecHit *rh =
875  new reco::PFRecHit( newDetId.rawId(), layer, energy,
876  position.x(), position.y(), position.z()+depth_correction,
877  0,0,0 );
878 
879 
880 
881 
882  // set the corners
883  const CaloCellGeometry::CornersVec& corners = thisCell->getCorners();
884 
885  rh->setNECorner( corners[0].x(), corners[0].y(), corners[0].z()+depth_correction );
886  rh->setSECorner( corners[1].x(), corners[1].y(), corners[1].z()+depth_correction );
887  rh->setSWCorner( corners[2].x(), corners[2].y(), corners[2].z()+depth_correction );
888  rh->setNWCorner( corners[3].x(), corners[3].y(), corners[3].z()+depth_correction );
889 
890  return rh;
891 }
void setSECorner(double posx, double posy, double posz)
Definition: PFRecHit.cc:100
void setNECorner(double posx, double posy, double posz)
Definition: PFRecHit.cc:105
T y() const
Definition: PV3DBase.h:63
virtual const CaloCellGeometry * getGeometry(const DetId &id) const
Get the cell geometry of a given detector id. Should return false if not found.
uint32_t rawId() const
get the raw id
Definition: DetId.h:43
void setSWCorner(double posx, double posy, double posz)
Definition: PFRecHit.cc:95
Particle flow rechit (rechit + geometry and topology information). See clustering algorithm in PFClus...
Definition: PFRecHit.h:35
T z() const
Definition: PV3DBase.h:64
void setNWCorner(double posx, double posy, double posz)
Definition: PFRecHit.cc:90
static int position[264][3]
Definition: ReadPGInfo.cc:509
const CornersVec & getCorners() const
Returns the corner points of this cell&#39;s volume.
const GlobalPoint & getPosition() const
Returns the position of reference for this cell.
T x() const
Definition: PV3DBase.h:62
void PFCTRecHitProducer::produce ( edm::Event iEvent,
const edm::EventSetup iSetup 
)
virtual

if ( !theStatusValue )

if ( !theStatusValue )

if ( !theStatusValue )

if ( !theStatusValue )

Implements edm::stream::EDProducerBase.

Definition at line 122 of file PFCTRecHitProducer.cc.

References funct::abs(), HLT_25ns14e33_v1_cff::caloTowers, CaloTower::constituents(), cond::rpcobgas::detid, alignCSCRings::e, DetId::Ecal, CaloTower::emEnergy(), relval_parameters_module::energy, edm::EventSetup::get(), edm::Event::getByToken(), edm::Event::getRefBeforePut(), HcalSeverityLevelComputer::getSeverityLevel(), HcalChannelStatus::getValue(), CaloTower::hadEnergy(), DetId::Hcal, PFLayer::HCAL_BARREL1, HLT_25ns14e33_v1_cff::HCAL_Calib_29, PFLayer::HCAL_ENDCAP, HcalBarrel, HcalEndcap, HcalForward, HcalOuter, HLT_25ns14e33_v1_cff::HF_Calib_29, PFLayer::HF_EM, PFLayer::HF_HAD, i, CaloTower::id(), HcalDetId::ieta(), HcalDetId::iphi(), j, bookConverter::max, edm::ESHandle< class >::product(), edm::Event::put(), HI_PhotonSkim_cff::rechits, reco::PFRecHit::setTime(), and HcalDetId::subdet().

123  {
124 
125  navigator_->beginEvent(iSetup);
126 
127  edm::ESHandle<CaloGeometry> geoHandle;
128  iSetup.get<CaloGeometryRecord>().get(geoHandle);
129 
130  // get the hcalBarrel geometry
131  const CaloSubdetectorGeometry *hcalBarrelGeometry =
132  geoHandle->getSubdetectorGeometry(DetId::Hcal, HcalBarrel);
133 
134  // get the endcap geometry
135  const CaloSubdetectorGeometry *hcalEndcapGeometry =
136  geoHandle->getSubdetectorGeometry(DetId::Hcal, HcalEndcap);
137 
138  // Get Hcal Severity Level Computer, so that the severity of each rechit flag/status may be determined
139  edm::ESHandle<HcalSeverityLevelComputer> hcalSevLvlComputerHndl;
140  iSetup.get<HcalSeverityLevelComputerRcd>().get(hcalSevLvlComputerHndl);
141  const HcalSeverityLevelComputer* hcalSevLvlComputer = hcalSevLvlComputerHndl.product();
142 
143 
144  auto_ptr< vector<reco::PFRecHit> > rechits( new vector<reco::PFRecHit> );
145  auto_ptr< vector<reco::PFRecHit> > rechitsCleaned( new vector<reco::PFRecHit> );
146  auto_ptr< vector<reco::PFRecHit> > HFHADRecHits( new vector<reco::PFRecHit> );
147  auto_ptr< vector<reco::PFRecHit> > HFEMRecHits( new vector<reco::PFRecHit> );
148 
150  iEvent.getByToken(towersToken_,caloTowers);
152  iEvent.getByToken(hfToken_,hfHandle);
153 
155  iEvent.getByToken(hcalToken_,hbheHandle);
156  // create rechits
158 
159  for(ICT ict=caloTowers->begin(); ict!=caloTowers->end();ict++) {
160  const CaloTower& ct = (*ict);
161 
162 
163  // get the hadronic energy.
164 
165  // Mike: Just ask for the Hadronic part only now!
166  // Patrick : ARGH ! While this is ok for the HCAL, this is
167  // just wrong for the HF (in which em/had are artificially
168  // separated.
169  double energy = ct.hadEnergy();
170  //Auguste: Photons in HF have no hadEnergy in fastsim: -> all RecHit collections are empty with photons.
171  double energyEM = ct.emEnergy(); // For HF !
172  //so test the total energy to deal with the photons in HF:
173  if( (energy+energyEM) < 1e-9 ) continue;
174 
175  //get the constituents of the tower
176  const std::vector<DetId>& hits = ct.constituents();
177  const std::vector<DetId>& allConstituents = theTowerConstituentsMap->constituentsOf(ct.id());
179  bool foundHCALConstituent = false;
180  //Loop on the calotower constituents and search for HCAL
181  double dead = 0.;
182  double alive = 0.;
183  for(unsigned int i=0;i< hits.size();++i) {
184  if(hits[i].det()==DetId::Hcal) {
185  foundHCALConstituent = true;
186  detid = hits[i];
187  // An HCAL tower was found: Look for dead ECAL channels in the same CaloTower.
188  if ( ECAL_Compensate_ && energy > ECAL_Threshold_ ) {
189  for(unsigned int j=0;j<allConstituents.size();++j) {
190  if ( allConstituents[j].det()==DetId::Ecal ) {
191  alive += 1.;
192  EcalChannelStatus::const_iterator chIt = theEcalChStatus->find(allConstituents[j]);
193  unsigned int dbStatus = chIt != theEcalChStatus->end() ? chIt->getStatusCode() : 0;
194  if ( dbStatus > ECAL_Dead_Code_ ) dead += 1.;
195  }
196  }
197  }
198  // Protection: tower 29 in HF is merged with tower 30.
199  // Just take the position of tower 30 in that case.
200  if ( detid.subdet() == HcalForward && abs(detid.ieta()) == 29 ) continue;
201  break;
202  }
203  }
204 
205  // In case of dead ECAL channel, rescale the HCAL energy...
206  double rescaleFactor = alive > 0. ? 1. + ECAL_Compensation_*dead/alive : 1.;
207 
208  reco::PFRecHit* pfrh = 0;
209  reco::PFRecHit* pfrhCleaned = 0;
210  //---ab: need 2 rechits for the HF:
211  reco::PFRecHit* pfrhHFEM = 0;
212  reco::PFRecHit* pfrhHFHAD = 0;
213  reco::PFRecHit* pfrhHFEMCleaned = 0;
214  reco::PFRecHit* pfrhHFHADCleaned = 0;
215  reco::PFRecHit* pfrhHFEMCleaned29 = 0;
216  reco::PFRecHit* pfrhHFHADCleaned29 = 0;
217 
218  if(foundHCALConstituent)
219  {
220  // std::cout << ", new Energy = " << energy << std::endl;
221  switch( detid.subdet() ) {
222  case HcalBarrel:
223  {
224  if(energy < thresh_Barrel_ ) continue;
225  if ( rescaleFactor > 1. ) {
226  pfrhCleaned = createHcalRecHit( detid,
227  energy,
229  hcalBarrelGeometry,
230  ct.id() );
231  pfrhCleaned->setTime(rescaleFactor);
232  energy *= rescaleFactor;
233  }
234  pfrh = createHcalRecHit( detid,
235  energy,
237  hcalBarrelGeometry,
238  ct.id() );
239  pfrh->setTime(rescaleFactor);
240  }
241  break;
242  case HcalEndcap:
243  {
244  if(energy < thresh_Endcap_ ) continue;
245  // Apply tower 29 calibration
246  if ( HCAL_Calib_ && abs(detid.ieta()) == 29 ) energy *= HCAL_Calib_29;
247  if ( rescaleFactor > 1. ) {
248  pfrhCleaned = createHcalRecHit( detid,
249  energy,
251  hcalEndcapGeometry,
252  ct.id() );
253  pfrhCleaned->setTime(rescaleFactor);
254  energy *= rescaleFactor;
255  }
256  pfrh = createHcalRecHit( detid,
257  energy,
259  hcalEndcapGeometry,
260  ct.id() );
261  pfrh->setTime(rescaleFactor);
262  }
263  break;
264  case HcalOuter:
265  {
266  }
267  break;
268  case HcalForward:
269  {
270  //---ab: 2 rechits for HF:
271  //double energyemHF = weight_HFem_*ct.emEnergy();
272  //double energyhadHF = weight_HFhad_*ct.hadEnergy();
273  double energyemHF = weight_HFem_ * energyEM;
274  double energyhadHF = weight_HFhad_ * energy;
275  // Some energy in the tower !
276  if((energyemHF+energyhadHF) < thresh_HF_ ) continue;
277 
278  // Some cleaning in the HF
279  double longFibre = energyemHF + energyhadHF/2.;
280  double shortFibre = energyhadHF/2.;
281  int ieta = detid.ieta();
282  int iphi = detid.iphi();
283  HcalDetId theLongDetId (HcalForward, ieta, iphi, 1);
284  HcalDetId theShortDetId (HcalForward, ieta, iphi, 2);
286  iHF theLongHit = hfHandle->find(theLongDetId);
287  iHF theShortHit = hfHandle->find(theShortDetId);
288  //
289  double theLongHitEnergy = 0.;
290  double theShortHitEnergy = 0.;
291  bool flagShortDPG = false;
292  bool flagLongDPG = false;
293  bool flagShortTimeDPG = false;
294  bool flagLongTimeDPG = false;
295  bool flagShortPulseDPG = false;
296  bool flagLongPulseDPG = false;
297  //
298  if ( theLongHit != hfHandle->end() ) {
299  int theLongFlag = theLongHit->flags();
300  theLongHitEnergy = theLongHit->energy();
301  flagLongDPG = applyLongShortDPG_ && ( hcalSevLvlComputer->getSeverityLevel(theLongDetId, theLongFlag & hcalHFLongShortFlagValue_, 0)> HcalMaxAllowedHFLongShortSev_);
302  flagLongTimeDPG = applyTimeDPG_ && ( hcalSevLvlComputer->getSeverityLevel(theLongDetId, theLongFlag & hcalHFInTimeWindowFlagValue_, 0)> HcalMaxAllowedHFInTimeWindowSev_);
303  flagLongPulseDPG = applyPulseDPG_ && ( hcalSevLvlComputer->getSeverityLevel(theLongDetId, theLongFlag & hcalHFDigiTimeFlagValue_, 0)> HcalMaxAllowedHFDigiTimeSev_);
304 
305  //flagLongDPG = applyLongShortDPG_ && theLongHit->flagField(HcalCaloFlagLabels::HFLongShort)==1;
306  //flagLongTimeDPG = applyTimeDPG_ && theLongHit->flagField(HcalCaloFlagLabels::HFInTimeWindow)==1;
307  //flagLongPulseDPG = applyPulseDPG_ && theLongHit->flagField(HcalCaloFlagLabels::HFDigiTime)==1;
308  }
309  //
310  if ( theShortHit != hfHandle->end() ) {
311  int theShortFlag = theShortHit->flags();
312  theShortHitEnergy = theShortHit->energy();
313  flagShortDPG = applyLongShortDPG_ && ( hcalSevLvlComputer->getSeverityLevel(theShortDetId, theShortFlag & hcalHFLongShortFlagValue_, 0)> HcalMaxAllowedHFLongShortSev_);
314  flagShortTimeDPG = applyTimeDPG_ && ( hcalSevLvlComputer->getSeverityLevel(theShortDetId, theShortFlag & hcalHFInTimeWindowFlagValue_, 0)> HcalMaxAllowedHFInTimeWindowSev_);
315  flagShortPulseDPG = applyPulseDPG_ && ( hcalSevLvlComputer->getSeverityLevel(theShortDetId, theShortFlag & hcalHFDigiTimeFlagValue_, 0)> HcalMaxAllowedHFDigiTimeSev_);
316  //flagShortDPG = applyLongShortDPG_ && theShortHit->flagField(HcalCaloFlagLabels::HFLongShort)==1;
317  //flagShortTimeDPG = applyTimeDPG_ && theShortHit->flagField(HcalCaloFlagLabels::HFInTimeWindow)==1;
318  //flagShortPulseDPG = applyPulseDPG_ && theShortHit->flagField(HcalCaloFlagLabels::HFDigiTime)==1;
319  }
320 
321  // Then check the timing in short and long fibres in all other towers.
322  if ( theShortHitEnergy > longShortFibre_Cut &&
323  ( theShortHit->time() < minShortTiming_Cut ||
324  theShortHit->time() > maxShortTiming_Cut ||
325  flagShortTimeDPG || flagShortPulseDPG ) ) {
326  // rescaleFactor = 0. ;
327  pfrhHFHADCleaned = createHcalRecHit( detid,
328  theShortHitEnergy,
330  hcalEndcapGeometry,
331  ct.id() );
332  pfrhHFHADCleaned->setTime(theShortHit->time());
333  /*
334  std::cout << "ieta/iphi = " << ieta << " " << iphi
335  << ", Energy em/had/long/short = "
336  << energyemHF << " " << energyhadHF << " "
337  << theLongHitEnergy << " " << theShortHitEnergy << " "
338  << ". Time = " << theShortHit->time() << " "
339  << ". The short and long flags : "
340  << flagShortDPG << " " << flagLongDPG << " "
341  << flagShortTimeDPG << " " << flagLongTimeDPG << " "
342  << flagShortPulseDPG << " " << flagLongPulseDPG << " "
343  << ". Short fibres were cleaned." << std::endl;
344  */
345  shortFibre -= theShortHitEnergy;
346  theShortHitEnergy = 0.;
347  }
348 
349 
350  if ( theLongHitEnergy > longShortFibre_Cut &&
351  ( theLongHit->time() < minLongTiming_Cut ||
352  theLongHit->time() > maxLongTiming_Cut ||
353  flagLongTimeDPG || flagLongPulseDPG ) ) {
354  //rescaleFactor = 0. ;
355  pfrhHFEMCleaned = createHcalRecHit( detid,
356  theLongHitEnergy,
358  hcalEndcapGeometry,
359  ct.id());
360  pfrhHFEMCleaned->setTime(theLongHit->time());
361  /*
362  std::cout << "ieta/iphi = " << ieta << " " << iphi
363  << ", Energy em/had/long/short = "
364  << energyemHF << " " << energyhadHF << " "
365  << theLongHitEnergy << " " << theShortHitEnergy << " "
366  << ". Time = " << theLongHit->time() << " "
367  << ". The short and long flags : "
368  << flagShortDPG << " " << flagLongDPG << " "
369  << flagShortTimeDPG << " " << flagLongTimeDPG << " "
370  << flagShortPulseDPG << " " << flagLongPulseDPG << " "
371  << ". Long fibres were cleaned." << std::endl;
372  */
373  longFibre -= theLongHitEnergy;
374  theLongHitEnergy = 0.;
375  }
376 
377  // Some energy must be in the long fibres is there is some energy in the short fibres !
378  if ( theShortHitEnergy > shortFibre_Cut &&
379  ( theLongHitEnergy/theShortHitEnergy < longFibre_Fraction ||
380  flagShortDPG ) ) {
381  // Check if the long-fibre hit was not cleaned already (because hot)
382  // In this case don't apply the cleaning
383  const HcalChannelStatus* theStatus = theHcalChStatus->getValues(theLongDetId);
384  unsigned theStatusValue = theStatus->getValue();
385  int theSeverityLevel = hcalSevLvlComputer->getSeverityLevel(detid, 0, theStatusValue);
386  // The channel is killed
388  if (theSeverityLevel<=HcalMaxAllowedChannelStatusSev_) {
389  // rescaleFactor = 0. ;
390  pfrhHFHADCleaned = createHcalRecHit( detid,
391  theShortHitEnergy,
393  hcalEndcapGeometry,
394  ct.id() );
395  pfrhHFHADCleaned->setTime(theShortHit->time());
396  /*
397  std::cout << "ieta/iphi = " << ieta << " " << iphi
398  << ", Energy em/had/long/short = "
399  << energyemHF << " " << energyhadHF << " "
400  << theLongHitEnergy << " " << theShortHitEnergy << " "
401  << ". Time = " << theShortHit->time() << " "
402  << ". The status value is " << theStatusValue
403  << ". The short and long flags : "
404  << flagShortDPG << " " << flagLongDPG << " "
405  << flagShortTimeDPG << " " << flagLongTimeDPG << " "
406  << flagShortPulseDPG << " " << flagLongPulseDPG << " "
407  << ". Short fibres were cleaned." << std::endl;
408  */
409  shortFibre -= theShortHitEnergy;
410  theShortHitEnergy = 0.;
411  }
412  }
413 
414  if ( theLongHitEnergy > longFibre_Cut &&
415  ( theShortHitEnergy/theLongHitEnergy < shortFibre_Fraction ||
416  flagLongDPG ) ) {
417  // Check if the long-fibre hit was not cleaned already (because hot)
418  // In this case don't apply the cleaning
419  const HcalChannelStatus* theStatus = theHcalChStatus->getValues(theShortDetId);
420  unsigned theStatusValue = theStatus->getValue();
421 
422  int theSeverityLevel = hcalSevLvlComputer->getSeverityLevel(detid, 0, theStatusValue);
423  // The channel is killed
425  if (theSeverityLevel<=HcalMaxAllowedChannelStatusSev_) {
426 
427  //rescaleFactor = 0. ;
428  pfrhHFEMCleaned = createHcalRecHit( detid,
429  theLongHitEnergy,
431  hcalEndcapGeometry,
432  ct.id() );
433  pfrhHFEMCleaned->setTime(theLongHit->time());
434  /*
435  std::cout << "ieta/iphi = " << ieta << " " << iphi
436  << ", Energy em/had/long/short = "
437  << energyemHF << " " << energyhadHF << " "
438  << theLongHitEnergy << " " << theShortHitEnergy << " "
439  << ". The status value is " << theStatusValue
440  << ". Time = " << theLongHit->time() << " "
441  << ". The short and long flags : "
442  << flagShortDPG << " " << flagLongDPG << " "
443  << flagShortTimeDPG << " " << flagLongTimeDPG << " "
444  << flagShortPulseDPG << " " << flagLongPulseDPG << " "
445  << ". Long fibres were cleaned." << std::endl;
446  */
447  longFibre -= theLongHitEnergy;
448  theLongHitEnergy = 0.;
449  }
450  }
451 
452  // Special treatment for tower 29
453  // A tower with energy only at ieta = +/- 29 is not physical -> Clean
454  if ( abs(ieta) == 29 ) {
455  // rescaleFactor = 0. ;
456  // Clean long fibres
457  if ( theLongHitEnergy > shortFibre_Cut/2. ) {
458  pfrhHFEMCleaned29 = createHcalRecHit( detid,
459  theLongHitEnergy,
461  hcalEndcapGeometry,
462  ct.id() );
463  pfrhHFEMCleaned29->setTime(theLongHit->time());
464  /*
465  std::cout << "ieta/iphi = " << ieta << " " << iphi
466  << ", Energy em/had/long/short = "
467  << energyemHF << " " << energyhadHF << " "
468  << theLongHitEnergy << " " << theShortHitEnergy << " "
469  << ". Long fibres were cleaned." << std::endl;
470  */
471  longFibre -= theLongHitEnergy;
472  theLongHitEnergy = 0.;
473  }
474  // Clean short fibres
475  if ( theShortHitEnergy > shortFibre_Cut/2. ) {
476  pfrhHFHADCleaned29 = createHcalRecHit( detid,
477  theShortHitEnergy,
479  hcalEndcapGeometry,
480  ct.id());
481  pfrhHFHADCleaned29->setTime(theShortHit->time());
482  /*
483  std::cout << "ieta/iphi = " << ieta << " " << iphi
484  << ", Energy em/had/long/short = "
485  << energyemHF << " " << energyhadHF << " "
486  << theLongHitEnergy << " " << theShortHitEnergy << " "
487  << ". Short fibres were cleaned." << std::endl;
488  */
489  shortFibre -= theShortHitEnergy;
490  theShortHitEnergy = 0.;
491  }
492  }
493  // Check the timing of the long and short fibre rechits
494 
495  // First, check the timing of long and short fibre in eta = 29 if tower 30.
496  else if ( abs(ieta) == 30 ) {
497  int ieta29 = ieta > 0 ? 29 : -29;
498  HcalDetId theLongDetId29 (HcalForward, ieta29, iphi, 1);
499  HcalDetId theShortDetId29 (HcalForward, ieta29, iphi, 2);
500  iHF theLongHit29 = hfHandle->find(theLongDetId29);
501  iHF theShortHit29 = hfHandle->find(theShortDetId29);
502  //
503  double theLongHitEnergy29 = 0.;
504  double theShortHitEnergy29 = 0.;
505  bool flagShortDPG29 = false;
506  bool flagLongDPG29 = false;
507  bool flagShortTimeDPG29 = false;
508  bool flagLongTimeDPG29 = false;
509  bool flagShortPulseDPG29 = false;
510  bool flagLongPulseDPG29 = false;
511  //
512  if ( theLongHit29 != hfHandle->end() ) {
513  int theLongFlag29 = theLongHit29->flags();
514  theLongHitEnergy29 = theLongHit29->energy() ;
515  flagLongDPG29 = applyLongShortDPG_ && ( hcalSevLvlComputer->getSeverityLevel(theLongDetId29, theLongFlag29 & hcalHFLongShortFlagValue_, 0)> HcalMaxAllowedHFLongShortSev_);
516  flagLongTimeDPG29 = applyTimeDPG_ && ( hcalSevLvlComputer->getSeverityLevel(theLongDetId29, theLongFlag29 & hcalHFInTimeWindowFlagValue_, 0)> HcalMaxAllowedHFInTimeWindowSev_);
517  flagLongPulseDPG29 = applyPulseDPG_ && ( hcalSevLvlComputer->getSeverityLevel(theLongDetId29, theLongFlag29 & hcalHFDigiTimeFlagValue_, 0)> HcalMaxAllowedHFDigiTimeSev_);
518 
519  //flagLongDPG29 = applyLongShortDPG_ && theLongHit29->flagField(HcalCaloFlagLabels::HFLongShort)==1;
520  //flagLongTimeDPG29 = applyTimeDPG_ && theLongHit29->flagField(HcalCaloFlagLabels::HFInTimeWindow)==1;
521  //flagLongPulseDPG29 = applyPulseDPG_ && theLongHit29->flagField(HcalCaloFlagLabels::HFDigiTime)==1;
522  }
523  //
524  if ( theShortHit29 != hfHandle->end() ) {
525  int theShortFlag29 = theShortHit29->flags();
526  theShortHitEnergy29 = theShortHit29->energy();
527  flagShortDPG29 = applyLongShortDPG_ && ( hcalSevLvlComputer->getSeverityLevel(theShortDetId29, theShortFlag29 & hcalHFLongShortFlagValue_, 0)> HcalMaxAllowedHFLongShortSev_);
528  flagShortTimeDPG29 = applyTimeDPG_ && ( hcalSevLvlComputer->getSeverityLevel(theShortDetId29, theShortFlag29 & hcalHFInTimeWindowFlagValue_, 0)> HcalMaxAllowedHFInTimeWindowSev_);
529  flagLongPulseDPG29 = applyPulseDPG_ && ( hcalSevLvlComputer->getSeverityLevel(theShortDetId29, theShortFlag29 & hcalHFDigiTimeFlagValue_, 0)> HcalMaxAllowedHFDigiTimeSev_);
530 
531  //flagShortDPG29 = applyLongShortDPG_ && theShortHit29->flagField(HcalCaloFlagLabels::HFLongShort)==1;
532  //flagShortTimeDPG29 = applyTimeDPG_ && theShortHit29->flagField(HcalCaloFlagLabels::HFInTimeWindow)==1;
533  //flagShortPulseDPG29 = applyPulseDPG_ && theShortHit29->flagField(HcalCaloFlagLabels::HFDigiTime)==1;
534  }
535 
536  if ( theLongHitEnergy29 > longShortFibre_Cut &&
537  ( theLongHit29->time() < minLongTiming_Cut ||
538  theLongHit29->time() > maxLongTiming_Cut ||
539  flagLongTimeDPG29 || flagLongPulseDPG29 ) ) {
540  //rescaleFactor = 0. ;
541  pfrhHFEMCleaned29 = createHcalRecHit( detid,
542  theLongHitEnergy29,
544  hcalEndcapGeometry,
545  ct.id() );
546  pfrhHFEMCleaned29->setTime(theLongHit29->time());
547  /*
548  std::cout << "ieta/iphi = " << ieta29 << " " << iphi
549  << ", Energy em/had/long/short = "
550  << energyemHF << " " << energyhadHF << " "
551  << theLongHitEnergy29 << " " << theShortHitEnergy29 << " "
552  << ". Time = " << theLongHit29->time() << " "
553  << ". The short and long flags : "
554  << flagShortDPG29 << " " << flagLongDPG29 << " "
555  << flagShortTimeDPG29 << " " << flagLongTimeDPG29 << " "
556  << flagShortPulseDPG29 << " " << flagLongPulseDPG29 << " "
557  << ". Long fibres were cleaned." << std::endl;
558  */
559  longFibre -= theLongHitEnergy29;
560  theLongHitEnergy29 = 0;
561  }
562 
563  if ( theShortHitEnergy29 > longShortFibre_Cut &&
564  ( theShortHit29->time() < minShortTiming_Cut ||
565  theShortHit29->time() > maxShortTiming_Cut ||
566  flagShortTimeDPG29 || flagShortPulseDPG29 ) ) {
567  //rescaleFactor = 0. ;
568  pfrhHFHADCleaned29 = createHcalRecHit( detid,
569  theShortHitEnergy29,
571  hcalEndcapGeometry,
572  ct.id() );
573  pfrhHFHADCleaned29->setTime(theShortHit29->time());
574  /*
575  std::cout << "ieta/iphi = " << ieta29 << " " << iphi
576  << ", Energy em/had/long/short = "
577  << energyemHF << " " << energyhadHF << " "
578  << theLongHitEnergy29 << " " << theShortHitEnergy29 << " "
579  << ". Time = " << theShortHit29->time() << " "
580  << ". The short and long flags : "
581  << flagShortDPG29 << " " << flagLongDPG29 << " "
582  << flagShortTimeDPG29 << " " << flagLongTimeDPG29 << " "
583  << flagShortPulseDPG29 << " " << flagLongPulseDPG29 << " "
584  << ". Short fibres were cleaned." << std::endl;
585  */
586  shortFibre -= theShortHitEnergy29;
587  theShortHitEnergy29 = 0.;
588  }
589 
590  // Some energy must be in the long fibres is there is some energy in the short fibres !
591  if ( theShortHitEnergy29 > shortFibre_Cut &&
592  ( theLongHitEnergy29/theShortHitEnergy29 < 2.*longFibre_Fraction ||
593  flagShortDPG29 ) ) {
594  // Check if the long-fibre hit was not cleaned already (because hot)
595  // In this case don't apply the cleaning
596  const HcalChannelStatus* theStatus = theHcalChStatus->getValues(theLongDetId29);
597  unsigned theStatusValue = theStatus->getValue();
598 
599  int theSeverityLevel = hcalSevLvlComputer->getSeverityLevel(detid, 0, theStatusValue);
600  // The channel is killed
602  if (theSeverityLevel<=HcalMaxAllowedChannelStatusSev_) {
603  //rescaleFactor = 0. ;
604  pfrhHFHADCleaned29 = createHcalRecHit( detid,
605  theShortHitEnergy29,
607  hcalEndcapGeometry,
608  ct.id() );
609  pfrhHFHADCleaned29->setTime(theShortHit29->time());
610  /*
611  std::cout << "ieta/iphi = " << ieta29 << " " << iphi
612  << ", Energy em/had/long/short = "
613  << energyemHF << " " << energyhadHF << " "
614  << theLongHitEnergy29 << " " << theShortHitEnergy29 << " "
615  << ". Time = " << theShortHit29->time() << " "
616  << ". The status value is " << theStatusValue
617  << ". The short and long flags : "
618  << flagShortDPG29 << " " << flagLongDPG29 << " "
619  << flagShortTimeDPG29 << " " << flagLongTimeDPG29 << " "
620  << flagShortPulseDPG29 << " " << flagLongPulseDPG29 << " "
621  << ". Short fibres were cleaned." << std::endl;
622  */
623  shortFibre -= theShortHitEnergy29;
624  theShortHitEnergy29 = 0.;
625  }
626  }
627 
628  // Some energy must be in the short fibres is there is some energy in the long fibres !
629  if ( theLongHitEnergy29 > longFibre_Cut &&
630  ( theShortHitEnergy29/theLongHitEnergy29 < shortFibre_Fraction ||
631  flagLongDPG29 ) ) {
632  // Check if the long-fibre hit was not cleaned already (because hot)
633  // In this case don't apply the cleaning
634  const HcalChannelStatus* theStatus = theHcalChStatus->getValues(theShortDetId29);
635  unsigned theStatusValue = theStatus->getValue();
636  int theSeverityLevel = hcalSevLvlComputer->getSeverityLevel(detid, 0, theStatusValue);
637  // The channel is killed
639  if (theSeverityLevel<=HcalMaxAllowedChannelStatusSev_) {
640 
641  //rescaleFactor = 0. ;
642  pfrhHFEMCleaned29 = createHcalRecHit( detid,
643  theLongHitEnergy29,
645  hcalEndcapGeometry,
646  ct.id() );
647  pfrhHFEMCleaned29->setTime(theLongHit29->time());
648  /*
649  std::cout << "ieta/iphi = " << ieta29 << " " << iphi
650  << ", Energy em/had/long/short = "
651  << energyemHF << " " << energyhadHF << " "
652  << theLongHitEnergy29 << " " << theShortHitEnergy29 << " "
653  << ". The status value is " << theStatusValue
654  << ". Time = " << theLongHit29->time() << " "
655  << ". The short and long flags : "
656  << flagShortDPG29 << " " << flagLongDPG29 << " "
657  << flagShortTimeDPG29 << " " << flagLongTimeDPG29 << " "
658  << flagShortPulseDPG29 << " " << flagLongPulseDPG29 << " "
659  << ". Long fibres were cleaned." << std::endl;
660  */
661  longFibre -= theLongHitEnergy29;
662  theLongHitEnergy29 = 0.;
663  }
664  }
665 
666 
667  // Check that the energy in tower 29 is smaller than in tower 30
668  // First in long fibres
669  if ( theLongHitEnergy29 > std::max(theLongHitEnergy,shortFibre_Cut/2) ) {
670  pfrhHFEMCleaned29 = createHcalRecHit( detid,
671  theLongHitEnergy29,
673  hcalEndcapGeometry,
674  ct.id() );
675  pfrhHFEMCleaned29->setTime(theLongHit29->time());
676  /*
677  std::cout << "ieta/iphi = " << ieta29 << " " << iphi
678  << ", Energy L29/S29/L30/S30 = "
679  << theLongHitEnergy29 << " " << theShortHitEnergy29 << " "
680  << theLongHitEnergy << " " << theShortHitEnergy << " "
681  << ". Long fibres were cleaned." << std::endl;
682  */
683  longFibre -= theLongHitEnergy29;
684  theLongHitEnergy29 = 0.;
685  }
686  // Second in short fibres
687  if ( theShortHitEnergy29 > std::max(theShortHitEnergy,shortFibre_Cut/2.) ) {
688  pfrhHFHADCleaned29 = createHcalRecHit( detid,
689  theShortHitEnergy29,
691  hcalEndcapGeometry,
692  ct.id() );
693  pfrhHFHADCleaned29->setTime(theShortHit29->time());
694  /*
695  std::cout << "ieta/iphi = " << ieta << " " << iphi
696  << ", Energy L29/S29/L30/S30 = "
697  << theLongHitEnergy29 << " " << theShortHitEnergy29 << " "
698  << theLongHitEnergy << " " << theShortHitEnergy << " "
699  << ". Short fibres were cleaned." << std::endl;
700  */
701  shortFibre -= theShortHitEnergy29;
702  theShortHitEnergy29 = 0.;
703  }
704  }
705 
706 
707  // Determine EM and HAD after cleaning of short and long fibres
708  energyhadHF = 2.*shortFibre;
709  energyemHF = longFibre - shortFibre;
710 
711  // The EM energy might be negative, as it amounts to Long - Short
712  // In that case, put the EM "energy" in the HAD energy
713  // Just to avoid systematic positive bias due to "Short" high fluctuations
714  if ( energyemHF < thresh_HF_ ) {
715  energyhadHF += energyemHF;
716  energyemHF = 0.;
717  }
718 
719  // Apply HCAL calibration factors flor towers close to 29, if requested
720  if ( HF_Calib_ && abs(detid.ieta()) <= 32 ) {
721  energyhadHF *= HF_Calib_29;
722  energyemHF *= HF_Calib_29;
723  }
724 
725  // Create an EM and a HAD rechit if above threshold.
726  if ( energyemHF > thresh_HF_ || energyhadHF > thresh_HF_ ) {
727  pfrhHFEM = createHcalRecHit( detid,
728  energyemHF,
730  hcalEndcapGeometry,
731  ct.id() );
732  pfrhHFHAD = createHcalRecHit( detid,
733  energyhadHF,
735  hcalEndcapGeometry,
736  ct.id() );
737 
738  }
739 
740  }
741  break;
742  default:
743  LogError("PFCTRecHitProducerHCAL")
744  <<"CaloTower constituent: unknown layer : "
745  <<detid.subdet()<<endl;
746  }
747 
748 
749  if(pfrh) {
750  rechits->push_back( *pfrh );
751  delete pfrh;
752  }
753  if(pfrhCleaned) {
754  rechitsCleaned->push_back( *pfrhCleaned );
755  delete pfrhCleaned;
756  }
757  if(pfrhHFEM) {
758  HFEMRecHits->push_back( *pfrhHFEM );
759  delete pfrhHFEM;
760  }
761  if(pfrhHFHAD) {
762  HFHADRecHits->push_back( *pfrhHFHAD );
763  delete pfrhHFHAD;
764  }
765  if(pfrhHFEMCleaned) {
766  rechitsCleaned->push_back( *pfrhHFEMCleaned );
767  delete pfrhHFEMCleaned;
768  }
769  if(pfrhHFHADCleaned) {
770  rechitsCleaned->push_back( *pfrhHFHADCleaned );
771  delete pfrhHFHADCleaned;
772  }
773  if(pfrhHFEMCleaned29) {
774  rechitsCleaned->push_back( *pfrhHFEMCleaned29 );
775  delete pfrhHFEMCleaned29;
776  }
777  if(pfrhHFHADCleaned29) {
778  rechitsCleaned->push_back( *pfrhHFHADCleaned29 );
779  delete pfrhHFHADCleaned29;
780  }
781  }
782  }
783 
784  //ok now do navigation
785  //create a refprod here
786 
789 
790 
791  for( unsigned int i=0;i<rechits->size();++i) {
793  }
794 
795  if (navigation_HF_) {
796 
799 
800 
801  for( unsigned int i=0;i<HFEMRecHits->size();++i) {
802  navigator_->associateNeighbours(HFEMRecHits->at(i),HFEMRecHits,refProdEM);
803  }
804 
806  iEvent.getRefBeforePut<reco::PFRecHitCollection>("HFHAD");
807 
808 
809  for( unsigned int i=0;i<HFHADRecHits->size();++i) {
810  navigator_->associateNeighbours(HFHADRecHits->at(i),HFHADRecHits,refProdHAD);
811  }
812  }
813 
814  iEvent.put( rechits,"" );
815  iEvent.put( rechitsCleaned,"Cleaned" );
816  iEvent.put( HFEMRecHits,"HFEM" );
817  iEvent.put( HFHADRecHits,"HFHAD" );
818 
819 }
int i
Definition: DBlmapReader.cc:9
PFRecHitNavigatorBase * navigator_
unsigned int ECAL_Dead_Code_
HcalSubdetector subdet() const
get the subdetector
Definition: HcalDetId.h:45
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:464
virtual void associateNeighbours(reco::PFRecHit &, std::auto_ptr< reco::PFRecHitCollection > &, edm::RefProd< reco::PFRecHitCollection > &)=0
double thresh_HF_
threshold for HF
edm::EDGetTokenT< HBHERecHitCollection > hcalToken_
std::vector< CaloTower >::const_iterator const_iterator
edm::EDGetTokenT< CaloTowerCollection > towersToken_
std::vector< PFRecHit > PFRecHitCollection
collection of PFRecHit objects
Definition: PFRecHitFwd.h:9
const Item * getValues(DetId fId, bool throwOnFail=true) const
reco::PFRecHit * createHcalRecHit(const DetId &detid, double energy, PFLayer::Layer layer, const CaloSubdetectorGeometry *geom, const CaloTowerDetId &newDetId)
edm::EDGetTokenT< HFRecHitCollection > hfToken_
std::vector< DetId > constituentsOf(const CaloTowerDetId &id) const
Get the constituent detids for this tower id ( not yet implemented )
Particle flow rechit (rechit + geometry and topology information). See clustering algorithm in PFClus...
Definition: PFRecHit.h:35
double emEnergy() const
Definition: CaloTower.h:109
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
Definition: Event.h:120
const HcalChannelQuality * theHcalChStatus
int ieta() const
get the cell ieta
Definition: HcalDetId.h:51
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
int j
Definition: DBlmapReader.cc:9
const std::vector< DetId > & constituents() const
Definition: CaloTower.h:103
void setTime(double time)
Definition: PFRecHit.h:78
RefProd< PROD > getRefBeforePut()
Definition: Event.h:140
const CaloTowerConstituentsMap * theTowerConstituentsMap
double hadEnergy() const
Definition: CaloTower.h:110
int iphi() const
get the cell iphi
Definition: HcalDetId.h:53
CaloTowerDetId id() const
Definition: CaloTower.h:102
const T & get() const
Definition: EventSetup.h:56
std::vector< Item >::const_iterator const_iterator
T const * product() const
Definition: ESHandle.h:86
int getSeverityLevel(const DetId &myid, const uint32_t &myflag, const uint32_t &mystatus) const
const EcalChannelStatus * theEcalChStatus
const_iterator find(uint32_t rawId) const
const_iterator end() const
uint32_t getValue() const
virtual void beginEvent(const edm::EventSetup &)=0

Member Data Documentation

bool PFCTRecHitProducer::applyLongShortDPG_
protected

Definition at line 90 of file PFCTRecHitProducer.h.

bool PFCTRecHitProducer::applyPulseDPG_
protected

Definition at line 100 of file PFCTRecHitProducer.h.

bool PFCTRecHitProducer::applyTimeDPG_
protected

Definition at line 99 of file PFCTRecHitProducer.h.

bool PFCTRecHitProducer::ECAL_Compensate_
protected

Definition at line 111 of file PFCTRecHitProducer.h.

double PFCTRecHitProducer::ECAL_Compensation_
protected

Definition at line 113 of file PFCTRecHitProducer.h.

unsigned int PFCTRecHitProducer::ECAL_Dead_Code_
protected

Definition at line 114 of file PFCTRecHitProducer.h.

double PFCTRecHitProducer::ECAL_Threshold_
protected

Definition at line 112 of file PFCTRecHitProducer.h.

double PFCTRecHitProducer::EM_Depth_
protected

Definition at line 117 of file PFCTRecHitProducer.h.

double PFCTRecHitProducer::HAD_Depth_
protected

Definition at line 118 of file PFCTRecHitProducer.h.

bool PFCTRecHitProducer::HCAL_Calib_
protected

Definition at line 76 of file PFCTRecHitProducer.h.

float PFCTRecHitProducer::HCAL_Calib_29
protected

Definition at line 78 of file PFCTRecHitProducer.h.

int PFCTRecHitProducer::hcalHFDigiTimeFlagValue_
protected

Definition at line 107 of file PFCTRecHitProducer.h.

int PFCTRecHitProducer::hcalHFInTimeWindowFlagValue_
protected

Definition at line 108 of file PFCTRecHitProducer.h.

int PFCTRecHitProducer::hcalHFLongShortFlagValue_
protected

Definition at line 106 of file PFCTRecHitProducer.h.

int PFCTRecHitProducer::HcalMaxAllowedChannelStatusSev_
protected

Definition at line 104 of file PFCTRecHitProducer.h.

int PFCTRecHitProducer::HcalMaxAllowedHFDigiTimeSev_
protected

Definition at line 102 of file PFCTRecHitProducer.h.

int PFCTRecHitProducer::HcalMaxAllowedHFInTimeWindowSev_
protected

Definition at line 103 of file PFCTRecHitProducer.h.

int PFCTRecHitProducer::HcalMaxAllowedHFLongShortSev_
protected

Definition at line 101 of file PFCTRecHitProducer.h.

edm::EDGetTokenT<HBHERecHitCollection> PFCTRecHitProducer::hcalToken_
protected

Definition at line 63 of file PFCTRecHitProducer.h.

bool PFCTRecHitProducer::HF_Calib_
protected

Definition at line 77 of file PFCTRecHitProducer.h.

float PFCTRecHitProducer::HF_Calib_29
protected

Definition at line 79 of file PFCTRecHitProducer.h.

edm::EDGetTokenT<HFRecHitCollection> PFCTRecHitProducer::hfToken_
protected

Definition at line 64 of file PFCTRecHitProducer.h.

double PFCTRecHitProducer::longFibre_Cut
protected

Definition at line 86 of file PFCTRecHitProducer.h.

double PFCTRecHitProducer::longFibre_Fraction
protected

Definition at line 83 of file PFCTRecHitProducer.h.

double PFCTRecHitProducer::longShortFibre_Cut
protected

Definition at line 93 of file PFCTRecHitProducer.h.

int PFCTRecHitProducer::m_maxDepthHB
protected

Definition at line 121 of file PFCTRecHitProducer.h.

int PFCTRecHitProducer::m_maxDepthHE
protected

Definition at line 122 of file PFCTRecHitProducer.h.

double PFCTRecHitProducer::maxLongTiming_Cut
protected

Definition at line 97 of file PFCTRecHitProducer.h.

double PFCTRecHitProducer::maxShortTiming_Cut
protected

Definition at line 95 of file PFCTRecHitProducer.h.

double PFCTRecHitProducer::minLongTiming_Cut
protected

Definition at line 96 of file PFCTRecHitProducer.h.

double PFCTRecHitProducer::minShortTiming_Cut
protected

Definition at line 94 of file PFCTRecHitProducer.h.

bool PFCTRecHitProducer::navigation_HF_
protected

Definition at line 71 of file PFCTRecHitProducer.h.

PFRecHitNavigatorBase* PFCTRecHitProducer::navigator_
protected

Definition at line 124 of file PFCTRecHitProducer.h.

double PFCTRecHitProducer::shortFibre_Cut
protected

Definition at line 82 of file PFCTRecHitProducer.h.

double PFCTRecHitProducer::shortFibre_Fraction
protected

Definition at line 87 of file PFCTRecHitProducer.h.

const EcalChannelStatus* PFCTRecHitProducer::theEcalChStatus
protected

Definition at line 58 of file PFCTRecHitProducer.h.

const HcalChannelQuality* PFCTRecHitProducer::theHcalChStatus
protected

Definition at line 57 of file PFCTRecHitProducer.h.

const CaloTowerConstituentsMap* PFCTRecHitProducer::theTowerConstituentsMap
protected

Definition at line 59 of file PFCTRecHitProducer.h.

double PFCTRecHitProducer::thresh_Barrel_
protected

Definition at line 55 of file PFCTRecHitProducer.h.

double PFCTRecHitProducer::thresh_Endcap_
protected

Definition at line 56 of file PFCTRecHitProducer.h.

double PFCTRecHitProducer::thresh_HF_
protected

threshold for HF

Definition at line 68 of file PFCTRecHitProducer.h.

edm::EDGetTokenT<CaloTowerCollection> PFCTRecHitProducer::towersToken_
protected

Definition at line 65 of file PFCTRecHitProducer.h.

double PFCTRecHitProducer::weight_HFem_
protected

Definition at line 72 of file PFCTRecHitProducer.h.

double PFCTRecHitProducer::weight_HFhad_
protected

Definition at line 73 of file PFCTRecHitProducer.h.