CMS 3D CMS Logo

Public Member Functions | Static Private Member Functions | Private Attributes | Static Private Attributes

ConversionTrackEcalImpactPoint Class Reference

#include <ConversionTrackEcalImpactPoint.h>

List of all members.

Public Member Functions

 ConversionTrackEcalImpactPoint (const MagneticField *field)
std::vector< math::XYZPointFfind (const std::vector< reco::TransientTrack > &tracks, const edm::Handle< edm::View< reco::CaloCluster > > &bcHandle)
std::vector< reco::CaloClusterPtrmatchingBC () const
void setMagneticField (const MagneticField *mf)
 ~ConversionTrackEcalImpactPoint ()

Static Private Member Functions

static const BoundCylinderbarrel ()
static float barrelHalfLength ()
static float barrelRadius ()
static void check ()
static float endcapRadius ()
static float endcapZ ()
static void initialize ()
static const BoundDisknegativeEtaEndcap ()
static const BoundDiskpositiveEtaEndcap ()

Private Attributes

PropagationDirection dir_
PropagatorWithMaterialforwardPropagator_
std::vector< reco::CaloClusterPtrmatchingBC_
TrajectoryStateOnSurface stateAtECAL_
const MagneticFieldtheMF_

Static Private Attributes

static
ReferenceCountingPointer
< BoundCylinder
theBarrel_ = 0
static bool theInit_ = false
static
ReferenceCountingPointer
< BoundDisk
theNegativeEtaEndcap_ = 0
static
ReferenceCountingPointer
< BoundDisk
thePositiveEtaEndcap_ = 0

Detailed Description

Author:
N. Marinelli - Univ. of Notre Dame
Version:

Definition at line 39 of file ConversionTrackEcalImpactPoint.h.


Constructor & Destructor Documentation

ConversionTrackEcalImpactPoint::ConversionTrackEcalImpactPoint ( const MagneticField field)

Definition at line 27 of file ConversionTrackEcalImpactPoint.cc.

References alongMomentum, dir_, forwardPropagator_, and theMF_.

ConversionTrackEcalImpactPoint::~ConversionTrackEcalImpactPoint ( )

Definition at line 36 of file ConversionTrackEcalImpactPoint.cc.

References forwardPropagator_.

                                                                {

    delete    forwardPropagator_ ; 
    
}

Member Function Documentation

static const BoundCylinder& ConversionTrackEcalImpactPoint::barrel ( ) [inline, static, private]

Definition at line 86 of file ConversionTrackEcalImpactPoint.h.

References check(), and theBarrel_.

Referenced by find().

{ check(); return *theBarrel_;}
static float ConversionTrackEcalImpactPoint::barrelHalfLength ( ) [inline, static, private]

Definition at line 72 of file ConversionTrackEcalImpactPoint.h.

Referenced by initialize().

{return 270.9f;} //p81, p50, ECAL TDR
static float ConversionTrackEcalImpactPoint::barrelRadius ( ) [inline, static, private]

Hard-wired numbers defining the surfaces on which the crystal front faces lie.

Definition at line 71 of file ConversionTrackEcalImpactPoint.h.

Referenced by initialize().

{return 129.f;} //p81, p50, ECAL TDR
static void ConversionTrackEcalImpactPoint::check ( void  ) [inline, static, private]

Definition at line 77 of file ConversionTrackEcalImpactPoint.h.

References initialize(), and theInit_.

Referenced by barrel(), negativeEtaEndcap(), and positiveEtaEndcap().

{if (!theInit_) initialize();}
static float ConversionTrackEcalImpactPoint::endcapRadius ( ) [inline, static, private]

Definition at line 73 of file ConversionTrackEcalImpactPoint.h.

Referenced by initialize().

{return 171.1f;} // fig 3.26, p81, ECAL TDR
static float ConversionTrackEcalImpactPoint::endcapZ ( ) [inline, static, private]

Definition at line 74 of file ConversionTrackEcalImpactPoint.h.

Referenced by initialize().

{return 320.5f;} // fig 3.26, p81, ECAL TDR
std::vector< math::XYZPointF > ConversionTrackEcalImpactPoint::find ( const std::vector< reco::TransientTrack > &  tracks,
const edm::Handle< edm::View< reco::CaloCluster > > &  bcHandle 
)

Definition at line 42 of file ConversionTrackEcalImpactPoint.cc.

References barrel(), dPhi(), PV3DBase< T, PVType, FrameType >::eta(), forwardPropagator_, TrajectoryStateOnSurface::globalPosition(), i, TrajectoryStateOnSurface::isValid(), matchingBC(), matchingBC_, negativeEtaEndcap(), positiveEtaEndcap(), PropagatorWithMaterial::propagate(), query::result, mathSSE::sqrt(), and stateAtECAL_.

Referenced by ConvertedPhotonProducer::buildCollections().

                                                                                                                                                                      {

  
  std::vector<math::XYZPointF> result;
  // 
  matchingBC_.clear();   

  std::vector<reco::CaloClusterPtr> matchingBC(2);


  // 



  int iTrk=0;
  for (    std::vector<reco::TransientTrack>::const_iterator iTk=tracks.begin(); iTk!=tracks.end(); ++iTk) {

    math::XYZPointF ecalImpactPosition(0.,0.,0.);
    const TrajectoryStateOnSurface myTSOS=(*iTk).innermostMeasurementState();
    if ( !( myTSOS.isValid() ) ) continue; 

    stateAtECAL_= forwardPropagator_->propagate( myTSOS, barrel() );
    

    if (!stateAtECAL_.isValid() || ( stateAtECAL_.isValid() && fabs(stateAtECAL_.globalPosition().eta() ) >1.479 )  ) {
    
         
      if ( (*iTk).innermostMeasurementState().globalPosition().eta() > 0.) {
        stateAtECAL_= forwardPropagator_->propagate( myTSOS, positiveEtaEndcap());

      } else {

        stateAtECAL_= forwardPropagator_->propagate( myTSOS, negativeEtaEndcap());

      }
    }


    if ( stateAtECAL_.isValid() ) ecalImpactPosition = stateAtECAL_.globalPosition();


    result.push_back(ecalImpactPosition  );


    if ( stateAtECAL_.isValid() ) { 
      int goodBC=0;
      float bcDistanceToTrack=9999;
      reco::CaloClusterPtr matchedBCItr;
      int ibc=0;
      goodBC=0;

      for (unsigned i = 0; i < bcHandle->size(); ++i ) {
        float dEta= bcHandle->ptrAt(i)->position().eta() - ecalImpactPosition.eta()  ;
        float dPhi= bcHandle->ptrAt(i)->position().phi() - ecalImpactPosition.phi()  ;
        if ( sqrt(dEta*dEta + dPhi*dPhi)  <  bcDistanceToTrack ) {
          goodBC=ibc;
          bcDistanceToTrack=sqrt(dEta*dEta + dPhi*dPhi);
        } 
        ibc++;  

      }

      matchingBC[iTrk]=bcHandle->ptrAt(goodBC);
    }
       
     
    iTrk++;
  }

  matchingBC_=matchingBC;

  return result;

}
void ConversionTrackEcalImpactPoint::initialize ( ) [static, private]
std::vector<reco::CaloClusterPtr> ConversionTrackEcalImpactPoint::matchingBC ( ) const [inline]

Definition at line 51 of file ConversionTrackEcalImpactPoint.h.

References matchingBC_.

Referenced by ConvertedPhotonProducer::buildCollections(), and find().

{return matchingBC_;}
static const BoundDisk& ConversionTrackEcalImpactPoint::negativeEtaEndcap ( ) [inline, static, private]

Definition at line 87 of file ConversionTrackEcalImpactPoint.h.

References check(), and theNegativeEtaEndcap_.

Referenced by find().

static const BoundDisk& ConversionTrackEcalImpactPoint::positiveEtaEndcap ( ) [inline, static, private]

Definition at line 88 of file ConversionTrackEcalImpactPoint.h.

References check(), and thePositiveEtaEndcap_.

Referenced by find().

void ConversionTrackEcalImpactPoint::setMagneticField ( const MagneticField mf) [inline]

Definition at line 52 of file ConversionTrackEcalImpactPoint.h.

References theMF_.

{ theMF_=mf;}

Member Data Documentation

Definition at line 65 of file ConversionTrackEcalImpactPoint.h.

Referenced by ConversionTrackEcalImpactPoint().

Definition at line 66 of file ConversionTrackEcalImpactPoint.h.

Referenced by find(), and matchingBC().

Definition at line 62 of file ConversionTrackEcalImpactPoint.h.

Referenced by find().

Definition at line 82 of file ConversionTrackEcalImpactPoint.h.

Referenced by barrel(), and initialize().

bool ConversionTrackEcalImpactPoint::theInit_ = false [static, private]

Definition at line 89 of file ConversionTrackEcalImpactPoint.h.

Referenced by check(), and initialize().

Definition at line 83 of file ConversionTrackEcalImpactPoint.h.

Referenced by initialize(), and negativeEtaEndcap().

Definition at line 84 of file ConversionTrackEcalImpactPoint.h.

Referenced by initialize(), and positiveEtaEndcap().