CMS 3D CMS Logo

TrackDetMatchInfo Class Reference

#include <TrackingTools/TrackAssociator/interface/TrackDetMatchInfo.h>

List of all members.

Public Types

enum  EnergyType {
  EcalRecHits, HcalRecHits, HORecHits, TowerTotal,
  TowerEcal, TowerHcal, TowerHO
}

Public Member Functions

double coneEnergy (double dR, EnergyType)
 cone energy around the track direction at the origin (0,0,0) ( not well defined for tracks originating away from IP)
double crossedEnergy (EnergyType)
 energy in detector elements crossed by the track by types
std::string dumpGeometry (const DetId &)
double ecalConeEnergy ()
double ecalCrossedEnergy ()
double ecalEnergy ()
double ecalTowerConeEnergy ()
double ecalTowerEnergy ()
DetId findMaxDeposition (EnergyType)
 Find detector elements with highest energy deposition.
GlobalPoint getPosition (const DetId &)
double hcalConeEnergy ()
double hcalCrossedEnergy ()
double hcalEnergy ()
double hcalTowerConeEnergy ()
double hcalTowerEnergy ()
double hoConeEnergy ()
double hoCrossedEnergy ()
double hoEnergy ()
double hoTowerConeEnergy ()
double hoTowerEnergy ()
int numberOfSegments () const
int numberOfSegmentsInDetector (int detector) const
int numberOfSegmentsInStation (int station, int detector) const
int numberOfSegmentsInStation (int station) const
double nXnEnergy (EnergyType, int gridSize=1)
 get energy of the NxN shape (N = 2*gridSize + 1) around track projection
double nXnEnergy (const DetId &, EnergyType, int gridSize=1)
 get energy of the NxN shape (N = 2*gridSize + 1) around given detector element
void setCaloGeometry (edm::ESHandle< CaloGeometry > geometry)
 TrackDetMatchInfo ()

Public Attributes

std::vector< TAMuonChamberMatchchambers
std::vector< DetIdcrossedEcalIds
 detector elements crossed by a track (regardless of whether energy was deposited or not)
std::vector< const EcalRecHit * > crossedEcalRecHits
 hits in detector elements crossed by a track
std::vector< DetIdcrossedHcalIds
std::vector< const HBHERecHit * > crossedHcalRecHits
std::vector< DetIdcrossedHOIds
std::vector< const HORecHit * > crossedHORecHits
std::vector< DetIdcrossedTowerIds
std::vector< const CaloTower * > crossedTowers
std::vector< const EcalRecHit * > ecalRecHits
 hits in the cone
double ecalTrueEnergy
std::vector< const HBHERecHit * > hcalRecHits
double hcalTrueEnergy
double hcalTrueEnergyCorrected
std::vector< const HORecHit * > hoRecHits
bool isGoodCalo
bool isGoodEcal
bool isGoodHcal
bool isGoodHO
bool isGoodMuon
const SimTracksimTrack
 MC truth info.
SimTrackRef simTrackRef_
FreeTrajectoryState stateAtIP
 track info
std::vector< const CaloTower * > towers
reco::TrackRef trackRef_
 Obsolete methods and data members for backward compatibility.
math::XYZPoint trkGlobPosAtEcal
 Track position at different parts of the calorimeter.
math::XYZPoint trkGlobPosAtHcal
math::XYZPoint trkGlobPosAtHO

Private Member Functions

bool insideCone (const DetId &, const double)

Private Attributes

edm::ESHandle< CaloGeometrycaloGeometry


Detailed Description

Definition at line 14 of file TrackDetMatchInfo.h.


Member Enumeration Documentation

enum TrackDetMatchInfo::EnergyType

Enumerator:
EcalRecHits 
HcalRecHits 
HORecHits 
TowerTotal 
TowerEcal 
TowerHcal 
TowerHO 

Definition at line 16 of file TrackDetMatchInfo.h.


Constructor & Destructor Documentation

TrackDetMatchInfo::TrackDetMatchInfo (  ) 

Definition at line 323 of file TrackDetMatchInfo.cc.

00323                                     :
00324        trkGlobPosAtEcal(0,0,0)
00325      , trkGlobPosAtHcal(0,0,0)
00326      , trkGlobPosAtHO(0,0,0)
00327      , isGoodEcal(false)
00328      , isGoodHcal(false)
00329      , isGoodCalo(false)
00330      , isGoodHO(false)
00331      , isGoodMuon(false)
00332      , simTrack(0)
00333      , ecalTrueEnergy(-999)
00334      , hcalTrueEnergy(-999)
00335 {
00336 }


Member Function Documentation

double TrackDetMatchInfo::coneEnergy ( double  dR,
EnergyType  type 
)

cone energy around the track direction at the origin (0,0,0) ( not well defined for tracks originating away from IP)

Definition at line 109 of file TrackDetMatchInfo.cc.

References crossedTowers, ecalRecHits, EcalRecHits, relval_parameters_module::energy, HcalRecHits, hcalRecHits, hoRecHits, HORecHits, insideCone(), TowerEcal, TowerHcal, TowerHO, and TowerTotal.

Referenced by ecalConeEnergy(), ecalTowerConeEnergy(), hcalConeEnergy(), hcalTowerConeEnergy(), hoConeEnergy(), hoTowerConeEnergy(), and AlCaIsoTracksProducer::produce().

00110 {
00111    double energy(0);
00112    switch (type) {
00113     case EcalRecHits:
00114         {
00115            for(std::vector<const EcalRecHit*>::const_iterator hit=ecalRecHits.begin(); hit!=ecalRecHits.end(); hit++)
00116              if (insideCone((*hit)->detid(),dR)) energy += (*hit)->energy();
00117         }
00118       break;
00119     case HcalRecHits:
00120         {
00121            for(std::vector<const HBHERecHit*>::const_iterator hit = hcalRecHits.begin(); hit != hcalRecHits.end(); hit++)
00122              if (insideCone((*hit)->detid(),dR)) energy += (*hit)->energy();
00123         }
00124       break;
00125     case HORecHits:
00126         {
00127            for(std::vector<const HORecHit*>::const_iterator hit = hoRecHits.begin(); hit != hoRecHits.end(); hit++)
00128              if (insideCone((*hit)->detid(),dR)) energy += (*hit)->energy();
00129         }
00130       break;
00131     case TowerTotal:
00132         {
00133            for(std::vector<const CaloTower*>::const_iterator hit=crossedTowers.begin(); hit!=crossedTowers.end(); hit++)
00134              if (insideCone((*hit)->id(),dR)) energy += (*hit)->energy();
00135         }
00136       break;
00137     case TowerEcal:
00138         {
00139            for(std::vector<const CaloTower*>::const_iterator hit=crossedTowers.begin(); hit!=crossedTowers.end(); hit++)
00140              if (insideCone((*hit)->id(),dR)) energy += (*hit)->emEnergy();
00141         }
00142       break;
00143     case TowerHcal:
00144         {
00145            for(std::vector<const CaloTower*>::const_iterator hit=crossedTowers.begin(); hit!=crossedTowers.end(); hit++)
00146              if (insideCone((*hit)->id(),dR)) energy += (*hit)->hadEnergy();
00147         }
00148       break;
00149     case TowerHO:
00150         {
00151            for(std::vector<const CaloTower*>::const_iterator hit=crossedTowers.begin(); hit!=crossedTowers.end(); hit++)
00152              if (insideCone((*hit)->id(),dR)) energy += (*hit)->outerEnergy();
00153         }
00154       break;
00155     default:
00156            edm::LogWarning("TrackAssociator") << "Unknown calo energy type: " << type;
00157    }
00158    return energy;
00159 }

double TrackDetMatchInfo::crossedEnergy ( EnergyType  type  ) 

energy in detector elements crossed by the track by types

Definition at line 48 of file TrackDetMatchInfo.cc.

References crossedEcalRecHits, crossedHcalRecHits, crossedHORecHits, crossedTowers, EcalRecHits, relval_parameters_module::energy, HcalRecHits, HORecHits, TowerEcal, TowerHcal, TowerHO, and TowerTotal.

Referenced by ecalCrossedEnergy(), ecalTowerEnergy(), MuonIdProducer::fillMuonId(), hcalCrossedEnergy(), hcalTowerEnergy(), hoCrossedEnergy(), hoTowerEnergy(), and CaloMuonProducer::makeMuon().

00049 {
00050    double energy(0);
00051    switch (type) {
00052     case EcalRecHits:
00053         {
00054            for(std::vector<const EcalRecHit*>::const_iterator hit=crossedEcalRecHits.begin(); hit!=crossedEcalRecHits.end(); hit++)
00055              energy += (*hit)->energy();
00056         }
00057       break;
00058     case HcalRecHits:
00059         {
00060            for(std::vector<const HBHERecHit*>::const_iterator hit = crossedHcalRecHits.begin(); hit != crossedHcalRecHits.end(); hit++)
00061              energy += (*hit)->energy();
00062         }
00063       break;
00064     case HORecHits:
00065         {
00066            for(std::vector<const HORecHit*>::const_iterator hit = crossedHORecHits.begin(); hit != crossedHORecHits.end(); hit++)
00067              energy += (*hit)->energy();
00068         }
00069       break;
00070     case TowerTotal:
00071         {
00072            for(std::vector<const CaloTower*>::const_iterator hit=crossedTowers.begin(); hit!=crossedTowers.end(); hit++)
00073              energy += (*hit)->energy();
00074         }
00075       break;
00076     case TowerEcal:
00077         {
00078            for(std::vector<const CaloTower*>::const_iterator hit=crossedTowers.begin(); hit!=crossedTowers.end(); hit++)
00079              energy += (*hit)->emEnergy();
00080         }
00081       break;
00082     case TowerHcal:
00083         {
00084            for(std::vector<const CaloTower*>::const_iterator hit=crossedTowers.begin(); hit!=crossedTowers.end(); hit++)
00085              energy += (*hit)->hadEnergy();
00086         }
00087       break;
00088     case TowerHO:
00089         {
00090            for(std::vector<const CaloTower*>::const_iterator hit=crossedTowers.begin(); hit!=crossedTowers.end(); hit++)
00091              energy += (*hit)->outerEnergy();
00092         }
00093       break;
00094     default:
00095            edm::LogWarning("TrackAssociator") << "Unknown calo energy type: " << type;
00096    }
00097    return energy;
00098 }

std::string TrackDetMatchInfo::dumpGeometry ( const DetId id  ) 

Definition at line 17 of file TrackDetMatchInfo.cc.

References EZArrayFL< T >::begin(), caloGeometry, EZArrayFL< T >::end(), and edm::ESHandle< T >::isValid().

00018 {
00019    if ( ! caloGeometry.isValid() || 
00020         ! caloGeometry->getSubdetectorGeometry(id) ||
00021         ! caloGeometry->getSubdetectorGeometry(id)->getGeometry(id) ) {
00022       edm::LogWarning("TrackAssociator")  << "Failed to access geometry for DetId: " << id.rawId();
00023       return std::string("");
00024    }
00025    std::ostringstream oss;
00026 
00027    const CaloCellGeometry::CornersVec& points = caloGeometry->getSubdetectorGeometry(id)->getGeometry(id)->getCorners();
00028    for( CaloCellGeometry::CornersVec::const_iterator point = points.begin();
00029        point != points.end(); ++point)
00030      oss << "(" << point->z() << ", " << point->perp() << ", " << point->eta() << ", " << point->phi() << "), \t";
00031    return oss.str();
00032 }

double TrackDetMatchInfo::ecalConeEnergy (  ) 

Definition at line 402 of file TrackDetMatchInfo.cc.

References coneEnergy(), and EcalRecHits.

00403 {
00404    return coneEnergy (999, EcalRecHits );
00405 }

double TrackDetMatchInfo::ecalCrossedEnergy (  ) 

Definition at line 417 of file TrackDetMatchInfo.cc.

References crossedEnergy(), and EcalRecHits.

Referenced by ecalEnergy().

00418 {
00419    return crossedEnergy( EcalRecHits );
00420 }

double TrackDetMatchInfo::ecalEnergy (  )  [inline]

Definition at line 96 of file TrackDetMatchInfo.h.

References ecalCrossedEnergy().

00096 { return ecalCrossedEnergy(); }

double TrackDetMatchInfo::ecalTowerConeEnergy (  )  [inline]

Definition at line 90 of file TrackDetMatchInfo.h.

References coneEnergy(), and TowerEcal.

00090 { return coneEnergy(999,TowerEcal); }

double TrackDetMatchInfo::ecalTowerEnergy (  )  [inline]

Definition at line 89 of file TrackDetMatchInfo.h.

References crossedEnergy(), and TowerEcal.

00089 { return crossedEnergy(TowerEcal); }

DetId TrackDetMatchInfo::findMaxDeposition ( EnergyType  type  ) 

Find detector elements with highest energy deposition.

Definition at line 338 of file TrackDetMatchInfo.cc.

References ecalRecHits, EcalRecHits, relval_parameters_module::energy, HcalRecHits, hcalRecHits, id, TowerEcal, TowerHcal, TowerHO, towers, and TowerTotal.

00339 {
00340    DetId id;
00341    float maxEnergy = -9999;
00342    switch (type) {
00343     case EcalRecHits:
00344         {
00345            for(std::vector<const EcalRecHit*>::const_iterator hit=ecalRecHits.begin(); hit!=ecalRecHits.end(); hit++)
00346              if ( (*hit)->energy() > maxEnergy ) {
00347                 maxEnergy = (*hit)->energy();
00348                 id = (*hit)->detid();
00349              }
00350         }
00351       break;
00352     case HcalRecHits:
00353         {
00354            for(std::vector<const HBHERecHit*>::const_iterator hit=hcalRecHits.begin(); hit!=hcalRecHits.end(); hit++)
00355              if ( (*hit)->energy() > maxEnergy ) {
00356                 maxEnergy = (*hit)->energy();
00357                 id = (*hit)->detid();
00358              }
00359         }
00360       break;
00361     case TowerTotal:
00362     case TowerEcal:
00363     case TowerHcal:
00364         {
00365            for(std::vector<const CaloTower*>::const_iterator hit=towers.begin(); hit!=towers.end(); hit++)
00366              {
00367                 double energy = 0;
00368                 switch (type) {
00369                  case TowerTotal:
00370                    energy = (*hit)->energy();
00371                    break;
00372                  case TowerEcal:
00373                    energy = (*hit)->emEnergy();
00374                    break;
00375                  case TowerHcal:
00376                    energy = (*hit)->hadEnergy();
00377                    break;
00378                  case TowerHO:
00379                    energy = (*hit)->energy();
00380                    break;
00381                  default:
00382                    edm::LogWarning("TrackAssociator") << "Unknown calo tower energy type: " << type;
00383                 }
00384                 if ( energy > maxEnergy ) {
00385                    maxEnergy = energy;
00386                    id = (*hit)->id();
00387                 }
00388              }
00389         }
00390     default:
00391       edm::LogWarning("TrackAssociator") << "Maximal energy deposition: unkown or not implemented energy type requested, type:" << type;
00392    }
00393    return id;
00394 }

GlobalPoint TrackDetMatchInfo::getPosition ( const DetId id  ) 

Definition at line 35 of file TrackDetMatchInfo.cc.

References caloGeometry, and edm::ESHandle< T >::isValid().

Referenced by insideCone().

00036 {
00037    // this part might be slow
00038    if ( ! caloGeometry.isValid() || 
00039         ! caloGeometry->getSubdetectorGeometry(id) ||
00040         ! caloGeometry->getSubdetectorGeometry(id)->getGeometry(id) ) {
00041       edm::LogWarning("TrackAssociator")  << "Failed to access geometry for DetId: " << id.rawId();
00042       return GlobalPoint(0,0,0);
00043    }
00044    return caloGeometry->getSubdetectorGeometry(id)->getGeometry(id)->getPosition();
00045 }

double TrackDetMatchInfo::hcalConeEnergy (  ) 

Definition at line 407 of file TrackDetMatchInfo.cc.

References coneEnergy(), and HcalRecHits.

00408 {
00409    return coneEnergy (999, HcalRecHits );
00410 }

double TrackDetMatchInfo::hcalCrossedEnergy (  ) 

Definition at line 422 of file TrackDetMatchInfo.cc.

References crossedEnergy(), and HcalRecHits.

Referenced by hcalEnergy().

00423 {
00424    return crossedEnergy( HcalRecHits );
00425 }

double TrackDetMatchInfo::hcalEnergy (  )  [inline]

Definition at line 97 of file TrackDetMatchInfo.h.

References hcalCrossedEnergy().

00097 { return hcalCrossedEnergy(); }

double TrackDetMatchInfo::hcalTowerConeEnergy (  )  [inline]

Definition at line 92 of file TrackDetMatchInfo.h.

References coneEnergy(), and TowerHcal.

00092 { return coneEnergy(999, TowerHcal); }

double TrackDetMatchInfo::hcalTowerEnergy (  )  [inline]

Definition at line 91 of file TrackDetMatchInfo.h.

References crossedEnergy(), and TowerHcal.

00091 { return crossedEnergy(TowerHcal); }

double TrackDetMatchInfo::hoConeEnergy (  ) 

Definition at line 412 of file TrackDetMatchInfo.cc.

References coneEnergy(), and HcalRecHits.

00413 {
00414    return coneEnergy (999, HcalRecHits );
00415 }

double TrackDetMatchInfo::hoCrossedEnergy (  ) 

Definition at line 427 of file TrackDetMatchInfo.cc.

References crossedEnergy(), and HORecHits.

Referenced by hoEnergy().

00428 {
00429    return crossedEnergy( HORecHits );
00430 }

double TrackDetMatchInfo::hoEnergy (  )  [inline]

Definition at line 98 of file TrackDetMatchInfo.h.

References hoCrossedEnergy().

00098 { return hoCrossedEnergy(); }

double TrackDetMatchInfo::hoTowerConeEnergy (  )  [inline]

Definition at line 94 of file TrackDetMatchInfo.h.

References coneEnergy(), and TowerHO.

00094 { return coneEnergy(999, TowerHO); }

double TrackDetMatchInfo::hoTowerEnergy (  )  [inline]

Definition at line 93 of file TrackDetMatchInfo.h.

References crossedEnergy(), and TowerHO.

00093 { return crossedEnergy(TowerHO); }

bool TrackDetMatchInfo::insideCone ( const DetId id,
const   double 
) [private]

Definition at line 100 of file TrackDetMatchInfo.cc.

References getPosition(), PV3DBase< T, PVType, FrameType >::mag(), FreeTrajectoryState::momentum(), stateAtIP, PV3DBase< T, PVType, FrameType >::x(), PV3DBase< T, PVType, FrameType >::y(), and PV3DBase< T, PVType, FrameType >::z().

Referenced by coneEnergy().

00100                                                                    {
00101    GlobalPoint idPosition = getPosition(id);
00102    if (idPosition.mag()<0.01) return false;
00103    
00104    math::XYZVector idPositionRoot( idPosition.x(), idPosition.y(), idPosition.z() );
00105    math::XYZVector trackP3( stateAtIP.momentum().x(), stateAtIP.momentum().y(), stateAtIP.momentum().z() );
00106    return ROOT::Math::VectorUtil::DeltaR(trackP3, idPositionRoot) < 0.5;
00107 }

int TrackDetMatchInfo::numberOfSegments (  )  const

Definition at line 433 of file TrackDetMatchInfo.cc.

References chambers.

00433                                               {
00434    int numSegments = 0;
00435    for(std::vector<TAMuonChamberMatch>::const_iterator chamber=chambers.begin(); chamber!=chambers.end(); chamber++)
00436      numSegments += chamber->segments.size();
00437    return numSegments;
00438 }

int TrackDetMatchInfo::numberOfSegmentsInDetector ( int  detector  )  const

Definition at line 454 of file TrackDetMatchInfo.cc.

References chambers.

00454                                                                     {
00455    int numSegments = 0;
00456    for(std::vector<TAMuonChamberMatch>::const_iterator chamber=chambers.begin(); chamber!=chambers.end(); chamber++)
00457      if(chamber->detector()==detector) numSegments += chamber->segments.size();
00458    return numSegments;
00459 }

int TrackDetMatchInfo::numberOfSegmentsInStation ( int  station,
int  detector 
) const

Definition at line 447 of file TrackDetMatchInfo.cc.

References chambers.

00447                                                                                 {
00448    int numSegments = 0;
00449    for(std::vector<TAMuonChamberMatch>::const_iterator chamber=chambers.begin(); chamber!=chambers.end(); chamber++)
00450      if(chamber->station()==station&&chamber->detector()==detector) numSegments += chamber->segments.size();
00451    return numSegments;
00452 }

int TrackDetMatchInfo::numberOfSegmentsInStation ( int  station  )  const

Definition at line 440 of file TrackDetMatchInfo.cc.

References chambers.

00440                                                                   {
00441    int numSegments = 0;
00442    for(std::vector<TAMuonChamberMatch>::const_iterator chamber=chambers.begin(); chamber!=chambers.end(); chamber++)
00443      if(chamber->station()==station) numSegments += chamber->segments.size();
00444    return numSegments;
00445 }

double TrackDetMatchInfo::nXnEnergy ( EnergyType  type,
int  gridSize = 1 
)

get energy of the NxN shape (N = 2*gridSize + 1) around track projection

Definition at line 290 of file TrackDetMatchInfo.cc.

References crossedEcalIds, crossedEcalRecHits, crossedHcalIds, crossedHcalRecHits, crossedHOIds, crossedHORecHits, crossedTowerIds, crossedTowers, EcalRecHits, HcalRecHits, HORecHits, nXnEnergy(), TowerEcal, TowerHcal, TowerHO, and TowerTotal.

00291 {
00292    switch (type)  {
00293     case TowerTotal:
00294     case TowerHcal:
00295     case TowerEcal:
00296     case TowerHO:
00297       if( crossedTowerIds.empty() ) return 0;
00298       if( crossedTowers.empty() ) return nXnEnergy(crossedTowerIds.front(), type, gridSize);
00299       return nXnEnergy(crossedTowers.front()->id(), type, gridSize);
00300       break;
00301     case EcalRecHits:
00302       if( crossedEcalIds.empty() ) return 0;
00303       if( crossedEcalRecHits.empty() )  return nXnEnergy(crossedEcalIds.front(), type, gridSize);
00304       return nXnEnergy(crossedEcalRecHits.front()->id(), type, gridSize);
00305       break;
00306     case HcalRecHits:
00307       if( crossedHcalIds.empty() ) return 0;
00308       if( crossedHcalRecHits.empty() )  return nXnEnergy(crossedHcalIds.front(), type, gridSize);
00309       return nXnEnergy(crossedHcalRecHits.front()->id(), type, gridSize);
00310       break;
00311     case HORecHits:
00312       if( crossedHOIds.empty() ) return 0;
00313       if( crossedHORecHits.empty() )    return nXnEnergy(crossedHOIds.front(), type, gridSize);
00314       return nXnEnergy(crossedHORecHits.front()->id(), type, gridSize);
00315       break;
00316     default:
00317       edm::LogWarning("TrackAssociator") << "Unkown or not implemented energy type requested, type:" << type;
00318    }
00319    return 0;
00320 }

double TrackDetMatchInfo::nXnEnergy ( const DetId id,
EnergyType  type,
int  gridSize = 1 
)

get energy of the NxN shape (N = 2*gridSize + 1) around given detector element

Definition at line 164 of file TrackDetMatchInfo.cc.

References funct::abs(), DetId::Calo, dPhi(), DetId::Ecal, EcalBarrel, EcalEndcap, ecalRecHits, EcalRecHits, relval_parameters_module::energy, DetId::Hcal, HcalBarrel, HcalEndcap, HcalOuter, HcalRecHits, hcalRecHits, hoRecHits, HORecHits, EBDetId::ieta(), CaloTowerDetId::ieta(), HcalDetId::ieta(), DetIdInfo::info(), HcalDetId::iphi(), EBDetId::iphi(), CaloTowerDetId::iphi(), EEDetId::ix(), EEDetId::iy(), TowerEcal, TowerHcal, TowerHO, towers, TowerTotal, and EEDetId::zside().

Referenced by MuonIdProducer::fillMuonId(), CaloMuonProducer::makeMuon(), and nXnEnergy().

00165 {
00166    if ( id.rawId() == 0 ) return 0.;
00167    switch (type)  {
00168     case TowerTotal:
00169     case TowerHcal:
00170     case TowerEcal:
00171     case TowerHO:
00172         {
00173            if ( id.det() != DetId::Calo ) {
00174               edm::LogWarning("TrackAssociator") << "Wrong DetId. Expected CaloTower, but found:\n" <<
00175                 DetIdInfo::info(id)<<"\n";
00176               return -99999;
00177            }
00178            CaloTowerDetId centerId(id);
00179            double energy(0);
00180            for(std::vector<const CaloTower*>::const_iterator hit=towers.begin(); hit!=towers.end(); hit++) {
00181               CaloTowerDetId neighborId((*hit)->id());
00182               int dEta = abs( (centerId.ieta()<0?centerId.ieta()+1:centerId.ieta() )
00183                               -(neighborId.ieta()<0?neighborId.ieta()+1:neighborId.ieta() ) ) ;
00184               int dPhi = abs( centerId.iphi()-neighborId.iphi() );
00185               if ( abs(72-dPhi) < dPhi ) dPhi = 72-dPhi;
00186               if(  dEta <= gridSize && dPhi <= gridSize ) {
00187                  switch (type) {
00188                   case TowerTotal:
00189                     energy += (*hit)->energy();
00190                     break;
00191                   case TowerEcal:
00192                     energy += (*hit)->emEnergy();
00193                     break;
00194                   case TowerHcal:
00195                     energy += (*hit)->hadEnergy();
00196                     break;
00197                   case TowerHO:
00198                     energy += (*hit)->outerEnergy();
00199                     break;
00200                   default:
00201                     edm::LogWarning("TrackAssociator") << "Unknown calo tower energy type: " << type;
00202                  }
00203               }
00204            }
00205            return energy;
00206         }
00207       break;
00208     case EcalRecHits:
00209         {
00210            if( id.det() != DetId::Ecal || (id.subdetId() != EcalBarrel && id.subdetId() != EcalEndcap) ) {
00211               edm::LogWarning("TrackAssociator") << "Wrong DetId. Expected EcalBarrel or EcalEndcap, but found:\n" <<
00212                 DetIdInfo::info(id)<<"\n";
00213               return -99999;
00214            }
00215            double energy(0);
00216            // Since the ECAL granularity is small and the gap between EE and EB is significant,
00217            // energy is computed only within the system that contains the central element
00218            if( id.subdetId() == EcalBarrel ) {
00219               EBDetId centerId(id);
00220               for(std::vector<const EcalRecHit*>::const_iterator hit=ecalRecHits.begin(); hit!=ecalRecHits.end(); hit++) {
00221                  if ((*hit)->id().subdetId() != EcalBarrel) continue;
00222                  EBDetId neighborId((*hit)->id());
00223                  int dEta = abs( (centerId.ieta()<0?centerId.ieta()+1:centerId.ieta() )
00224                                  -(neighborId.ieta()<0?neighborId.ieta()+1:neighborId.ieta() ) ) ;
00225                  int dPhi = abs( centerId.iphi()-neighborId.iphi() );
00226                  if ( abs(360-dPhi) < dPhi ) dPhi = 360-dPhi;
00227                  if(  dEta <= gridSize && dPhi <= gridSize ) energy += (*hit)->energy();
00228               }
00229               return energy;
00230            }
00231 
00232            // Endcap
00233            EEDetId centerId(id);
00234            for(std::vector<const EcalRecHit*>::const_iterator hit=ecalRecHits.begin(); hit!=ecalRecHits.end(); hit++) {
00235               if ((*hit)->id().subdetId() != EcalEndcap) continue;
00236               EEDetId neighborId((*hit)->id());
00237               if(  centerId.zside() == neighborId.zside() && 
00238                    abs(centerId.ix()-neighborId.ix()) <= gridSize && 
00239                    abs(centerId.iy()-neighborId.iy()) <= gridSize ) energy += (*hit)->energy();
00240            }
00241            return energy;
00242         }
00243       break;
00244     case HcalRecHits:
00245         {
00246            if( id.det() != DetId::Hcal || (id.subdetId() != HcalBarrel && id.subdetId() != HcalEndcap) ) {
00247               edm::LogWarning("TrackAssociator") << "Wrong DetId. Expected HE or HB, but found:\n" <<
00248                 DetIdInfo::info(id)<<"\n";
00249               return -99999;
00250            }
00251            HcalDetId centerId(id);
00252            double energy(0);
00253            for(std::vector<const HBHERecHit*>::const_iterator hit=hcalRecHits.begin(); hit!=hcalRecHits.end(); hit++) {
00254               HcalDetId neighborId((*hit)->id());
00255               int dEta = abs( (centerId.ieta()<0?centerId.ieta()+1:centerId.ieta() )
00256                               -(neighborId.ieta()<0?neighborId.ieta()+1:neighborId.ieta() ) ) ;
00257               int dPhi = abs( centerId.iphi()-neighborId.iphi() );
00258               if ( abs(72-dPhi) < dPhi ) dPhi = 72-dPhi;
00259               if(  dEta <= gridSize && dPhi <= gridSize ) energy += (*hit)->energy();
00260            }
00261            return energy;
00262         }
00263       break;
00264     case HORecHits:
00265         {
00266            if( id.det() != DetId::Hcal || (id.subdetId() != HcalOuter) ) {
00267               edm::LogWarning("TrackAssociator") << "Wrong DetId. Expected HO, but found:\n" <<
00268                 DetIdInfo::info(id)<<"\n";
00269               return -99999;
00270            }
00271            HcalDetId centerId(id);
00272            double energy(0);
00273            for(std::vector<const HORecHit*>::const_iterator hit=hoRecHits.begin(); hit!=hoRecHits.end(); hit++) {
00274               HcalDetId neighborId((*hit)->id());
00275               int dEta = abs( (centerId.ieta()<0?centerId.ieta()+1:centerId.ieta() )
00276                               -(neighborId.ieta()<0?neighborId.ieta()+1:neighborId.ieta() ) ) ;
00277               int dPhi = abs( centerId.iphi()-neighborId.iphi() );
00278               if ( abs(72-dPhi) < dPhi ) dPhi = 72-dPhi;
00279               if(  dEta <= gridSize && dPhi <= gridSize ) energy += (*hit)->energy();
00280            }
00281            return energy;
00282         }
00283       break;
00284     default:
00285       edm::LogWarning("TrackAssociator") << "Unkown or not implemented energy type requested, type:" << type;
00286    }
00287    return 0;
00288 }

void TrackDetMatchInfo::setCaloGeometry ( edm::ESHandle< CaloGeometry geometry  )  [inline]

Definition at line 105 of file TrackDetMatchInfo.h.

References caloGeometry.

Referenced by TrackDetectorAssociator::associate().

00105 { caloGeometry = geometry; }


Member Data Documentation

edm::ESHandle<CaloGeometry> TrackDetMatchInfo::caloGeometry [private]

Definition at line 110 of file TrackDetMatchInfo.h.

Referenced by dumpGeometry(), getPosition(), and setCaloGeometry().

std::vector<TAMuonChamberMatch> TrackDetMatchInfo::chambers

Definition at line 66 of file TrackDetMatchInfo.h.

Referenced by TrackDetectorAssociator::fillMuon(), MuonIdProducer::fillMuonId(), numberOfSegments(), numberOfSegmentsInDetector(), and numberOfSegmentsInStation().

std::vector<DetId> TrackDetMatchInfo::crossedEcalIds

detector elements crossed by a track (regardless of whether energy was deposited or not)

Definition at line 61 of file TrackDetMatchInfo.h.

Referenced by muonisolation::CaloExtractorByAssociator::deposits(), TrackDetectorAssociator::fillEcal(), and nXnEnergy().

std::vector<const EcalRecHit*> TrackDetMatchInfo::crossedEcalRecHits

hits in detector elements crossed by a track

Definition at line 54 of file TrackDetMatchInfo.h.

Referenced by crossedEnergy(), TrackDetectorAssociator::fillEcal(), and nXnEnergy().

std::vector<DetId> TrackDetMatchInfo::crossedHcalIds

Definition at line 62 of file TrackDetMatchInfo.h.

Referenced by muonisolation::CaloExtractorByAssociator::deposits(), TrackDetectorAssociator::fillHcal(), and nXnEnergy().

std::vector<const HBHERecHit*> TrackDetMatchInfo::crossedHcalRecHits

Definition at line 55 of file TrackDetMatchInfo.h.

Referenced by crossedEnergy(), TrackDetectorAssociator::fillHcal(), and nXnEnergy().

std::vector<DetId> TrackDetMatchInfo::crossedHOIds

Definition at line 63 of file TrackDetMatchInfo.h.

Referenced by muonisolation::CaloExtractorByAssociator::deposits(), TrackDetectorAssociator::fillHO(), and nXnEnergy().

std::vector<const HORecHit*> TrackDetMatchInfo::crossedHORecHits

Definition at line 56 of file TrackDetMatchInfo.h.

Referenced by crossedEnergy(), TrackDetectorAssociator::fillHO(), and nXnEnergy().

std::vector<DetId> TrackDetMatchInfo::crossedTowerIds

Definition at line 64 of file TrackDetMatchInfo.h.

Referenced by muonisolation::JetExtractor::deposit(), muonisolation::CaloExtractorByAssociator::deposits(), TrackDetectorAssociator::fillCaloTowers(), and nXnEnergy().

std::vector<const CaloTower*> TrackDetMatchInfo::crossedTowers

Definition at line 57 of file TrackDetMatchInfo.h.

Referenced by coneEnergy(), crossedEnergy(), muonisolation::JetExtractor::deposit(), TrackDetectorAssociator::fillCaloTowers(), MuonMETAlgo::MuonMETAlgo_run(), and nXnEnergy().

std::vector<const EcalRecHit*> TrackDetMatchInfo::ecalRecHits

hits in the cone

Definition at line 48 of file TrackDetMatchInfo.h.

Referenced by coneEnergy(), muonisolation::CaloExtractorByAssociator::deposits(), TrackDetectorAssociator::fillEcal(), findMaxDeposition(), and nXnEnergy().

double TrackDetMatchInfo::ecalTrueEnergy

Definition at line 73 of file TrackDetMatchInfo.h.

Referenced by TrackDetectorAssociator::fillCaloTruth().

std::vector<const HBHERecHit*> TrackDetMatchInfo::hcalRecHits

Definition at line 49 of file TrackDetMatchInfo.h.

Referenced by coneEnergy(), muonisolation::CaloExtractorByAssociator::deposits(), TrackDetectorAssociator::fillHcal(), findMaxDeposition(), and nXnEnergy().

double TrackDetMatchInfo::hcalTrueEnergy

Definition at line 74 of file TrackDetMatchInfo.h.

Referenced by TrackDetectorAssociator::fillCaloTruth().

double TrackDetMatchInfo::hcalTrueEnergyCorrected

Definition at line 75 of file TrackDetMatchInfo.h.

Referenced by TrackDetectorAssociator::fillCaloTruth().

std::vector<const HORecHit*> TrackDetMatchInfo::hoRecHits

Definition at line 50 of file TrackDetMatchInfo.h.

Referenced by coneEnergy(), muonisolation::CaloExtractorByAssociator::deposits(), TrackDetectorAssociator::fillHO(), and nXnEnergy().

bool TrackDetMatchInfo::isGoodCalo

Definition at line 43 of file TrackDetMatchInfo.h.

Referenced by TrackDetectorAssociator::fillCaloTowers().

bool TrackDetMatchInfo::isGoodEcal

Definition at line 41 of file TrackDetMatchInfo.h.

Referenced by SinglePionEfficiencyNew::analyze(), TrackDetectorAssociator::fillEcal(), and SoftElectronProducer::produce().

bool TrackDetMatchInfo::isGoodHcal

Definition at line 42 of file TrackDetMatchInfo.h.

Referenced by TrackDetectorAssociator::fillHcal().

bool TrackDetMatchInfo::isGoodHO

Definition at line 44 of file TrackDetMatchInfo.h.

Referenced by TrackDetectorAssociator::fillHO().

bool TrackDetMatchInfo::isGoodMuon

Definition at line 45 of file TrackDetMatchInfo.h.

const SimTrack* TrackDetMatchInfo::simTrack

MC truth info.

Definition at line 72 of file TrackDetMatchInfo.h.

Referenced by TrackDetectorAssociator::fillCaloTruth().

SimTrackRef TrackDetMatchInfo::simTrackRef_

Definition at line 80 of file TrackDetMatchInfo.h.

FreeTrajectoryState TrackDetMatchInfo::stateAtIP

track info

Definition at line 69 of file TrackDetMatchInfo.h.

Referenced by TrackDetectorAssociator::associate(), TrackDetectorAssociator::fillCaloTruth(), and insideCone().

std::vector<const CaloTower*> TrackDetMatchInfo::towers

Definition at line 51 of file TrackDetMatchInfo.h.

Referenced by muonisolation::CaloExtractorByAssociator::deposits(), TrackDetectorAssociator::fillCaloTowers(), findMaxDeposition(), and nXnEnergy().

reco::TrackRef TrackDetMatchInfo::trackRef_

Obsolete methods and data members for backward compatibility.

Will be removed in future releases.

Definition at line 79 of file TrackDetMatchInfo.h.

math::XYZPoint TrackDetMatchInfo::trkGlobPosAtEcal

Track position at different parts of the calorimeter.

Definition at line 37 of file TrackDetMatchInfo.h.

Referenced by SinglePionEfficiencyNew::analyze(), HcalIsoTrkAnalyzer::analyze(), TrackDetectorAssociator::associate(), muonisolation::CaloExtractorByAssociator::deposits(), InvariantMassAlgorithm::getMinimumClusterDR(), MuonMETAlgo::MuonMETAlgo_run(), SoftElectronProducer::produce(), and AlCaIsoTracksProducer::produce().

math::XYZPoint TrackDetMatchInfo::trkGlobPosAtHcal

Definition at line 38 of file TrackDetMatchInfo.h.

Referenced by TrackDetectorAssociator::associate(), muonisolation::JetExtractor::deposit(), muonisolation::CaloExtractorByAssociator::deposits(), TrackDetectorAssociator::fillCaloTruth(), and MuonMETAlgo::MuonMETAlgo_run().

math::XYZPoint TrackDetMatchInfo::trkGlobPosAtHO

Definition at line 39 of file TrackDetMatchInfo.h.

Referenced by TrackDetectorAssociator::associate(), muonisolation::CaloExtractorByAssociator::deposits(), and MuonMETAlgo::MuonMETAlgo_run().


The documentation for this class was generated from the following files:
Generated on Tue Jun 9 18:34:03 2009 for CMSSW by  doxygen 1.5.4