CMS 3D CMS Logo

Public Member Functions | Private Member Functions | Private Attributes

DTRecHitQuality Class Reference

#include <DTRecHitQuality.h>

Inheritance diagram for DTRecHitQuality:
edm::EDAnalyzer

List of all members.

Public Member Functions

void analyze (const edm::Event &event, const edm::EventSetup &eventSetup)
 Perform the real analysis.
 DTRecHitQuality (const edm::ParameterSet &pset)
 Constructor.
void endJob ()
template<typename type >
const typefindBestRecHit (const DTLayer *layer, DTWireId wireId, const vector< type > &recHits, const float simHitDist)
virtual ~DTRecHitQuality ()
 Destructor.

Private Member Functions

template<typename type >
void compute (const DTGeometry *dtGeom, std::map< DTWireId, std::vector< PSimHit > > simHitsPerWire, std::map< DTWireId, std::vector< type > > recHitsPerWire, int step)
template<typename type >
const typefindBestRecHit (const DTLayer *layer, DTWireId wireId, const std::vector< type > &recHits, const float simHitDist)
std::map< DTWireId,
std::vector< DTRecHit1D > > 
map1DRecHitsPerWire (const DTRecSegment2DCollection *segment2Ds)
std::map< DTWireId,
std::vector< DTRecHit1DPair > > 
map1DRecHitsPerWire (const DTRecHitCollection *dt1DRecHitPairs)
std::map< DTWireId,
std::vector< DTRecHit1D > > 
map1DRecHitsPerWire (const DTRecSegment4DCollection *segment4Ds)
float recHitDistFromWire (const DTRecHit1DPair &hitPair, const DTLayer *layer)
float recHitDistFromWire (const DTRecHit1D &recHit, const DTLayer *layer)
float recHitPositionError (const DTRecHit1DPair &recHit)
float recHitPositionError (const DTRecHit1D &recHit)
float simHitDistFromFE (const DTLayer *layer, DTWireId wireId, const PSimHit &hit)
float simHitDistFromWire (const DTLayer *layer, DTWireId wireId, const PSimHit &hit)
float simHitImpactAngle (const DTLayer *layer, DTWireId wireId, const PSimHit &hit)

Private Attributes

bool debug
bool doStep1
bool doStep2
bool doStep3
HEff1DHithEff_S1RPhi
HEff1DHithEff_S1RZ
HEff1DHithEff_S1RZ_W0
HEff1DHithEff_S1RZ_W1
HEff1DHithEff_S1RZ_W2
HEff1DHithEff_S2RPhi
HEff1DHithEff_S2RZ
HEff1DHithEff_S2RZ_W0
HEff1DHithEff_S2RZ_W1
HEff1DHithEff_S2RZ_W2
HEff1DHithEff_S3RPhi
HEff1DHithEff_S3RZ
HEff1DHithEff_S3RZ_W0
HEff1DHithEff_S3RZ_W1
HEff1DHithEff_S3RZ_W2
HRes1DHithRes_S1RPhi
HRes1DHithRes_S1RZ
HRes1DHithRes_S1RZ_W0
HRes1DHithRes_S1RZ_W1
HRes1DHithRes_S1RZ_W2
HRes1DHithRes_S2RPhi
HRes1DHithRes_S2RZ
HRes1DHithRes_S2RZ_W0
HRes1DHithRes_S2RZ_W1
HRes1DHithRes_S2RZ_W2
HRes1DHithRes_S3RPhi
HRes1DHithRes_S3RZ
HRes1DHithRes_S3RZ_W0
HRes1DHithRes_S3RZ_W1
HRes1DHithRes_S3RZ_W2
std::string recHitLabel
std::string rootFileName
std::string segment2DLabel
std::string segment4DLabel
std::string simHitLabel
TFile * theFile

Detailed Description

Basic analyzer class which accesses 1D DTRecHits and plot resolution comparing reconstructed and simulated quantities

Date:
2007/10/25 11:58:37
Revision:
1.1
Author:
G. Cerminara - INFN Torino

Definition at line 39 of file DTRecHitQuality.h.


Constructor & Destructor Documentation

DTRecHitQuality::DTRecHitQuality ( const edm::ParameterSet pset)

Constructor.

Definition at line 36 of file DTRecHitQuality.cc.

References debug, edm::ParameterSet::getUntrackedParameter(), and interactiveExample::theFile.

                                                        {
  // Get the debug parameter for verbose output
  debug = pset.getUntrackedParameter<bool>("debug");
  rootFileName = pset.getUntrackedParameter<string>("rootFileName");
  // the name of the simhit collection
  simHitLabel = pset.getUntrackedParameter<string>("simHitLabel", "SimG4Object");
  // the name of the 1D rec hit collection
  recHitLabel = pset.getUntrackedParameter<string>("recHitLabel", "DTRecHit1DProducer");
  // the name of the 2D rec hit collection
  segment2DLabel = pset.getUntrackedParameter<string>("segment2DLabel");
  // the name of the 4D rec hit collection
  segment4DLabel = pset.getUntrackedParameter<string>("segment4DLabel");

  // Switches for analysis at various steps
  doStep1 = pset.getUntrackedParameter<bool>("doStep1", false);
  doStep2 = pset.getUntrackedParameter<bool>("doStep2", false);
  doStep3 = pset.getUntrackedParameter<bool>("doStep3", false);

  // Create the root file
  theFile = new TFile(rootFileName.c_str(), "RECREATE");
  theFile->cd();


  hRes_S1RPhi= new HRes1DHit("S1RPhi");     // RecHits, 1. step, RPhi
  hRes_S2RPhi= new HRes1DHit("S2RPhi");     // RecHits, 2. step, RPhi
  hRes_S3RPhi= new HRes1DHit("S3RPhi");     // RecHits, 3. step, RPhi

  hRes_S1RZ= new HRes1DHit("S1RZ");         // RecHits, 1. step, RZ
  hRes_S2RZ= new HRes1DHit("S2RZ");         // RecHits, 2. step, RZ
  hRes_S3RZ= new HRes1DHit("S3RZ");         // RecHits, 3. step, RZ

  hRes_S1RZ_W0= new HRes1DHit("S1RZ_W0");   // RecHits, 1. step, RZ, wheel 0
  hRes_S2RZ_W0= new HRes1DHit("S2RZ_W0");   // RecHits, 2. step, RZ, wheel 0
  hRes_S3RZ_W0= new HRes1DHit("S3RZ_W0");   // RecHits, 3. step, RZ, wheel 0

  hRes_S1RZ_W1= new HRes1DHit("S1RZ_W1");   // RecHits, 1. step, RZ, wheel +-1
  hRes_S2RZ_W1= new HRes1DHit("S2RZ_W1");   // RecHits, 2. step, RZ, wheel +-1
  hRes_S3RZ_W1= new HRes1DHit("S3RZ_W1");   // RecHits, 3. step, RZ, wheel +-1

  hRes_S1RZ_W2= new HRes1DHit("S1RZ_W2");   // RecHits, 1. step, RZ, wheel +-2
  hRes_S2RZ_W2= new HRes1DHit("S2RZ_W2");   // RecHits, 2. step, RZ, wheel +-2
  hRes_S3RZ_W2= new HRes1DHit("S3RZ_W2");   // RecHits, 3. step, RZ, wheel +-2

  hEff_S1RPhi= new HEff1DHit("S1RPhi");     // RecHits, 1. step, RPhi
  hEff_S2RPhi= new HEff1DHit("S2RPhi");     // RecHits, 2. step, RPhi
  hEff_S3RPhi= new HEff1DHit("S3RPhi");     // RecHits, 3. step, RPhi

  hEff_S1RZ= new HEff1DHit("S1RZ");         // RecHits, 1. step, RZ
  hEff_S2RZ= new HEff1DHit("S2RZ");         // RecHits, 2. step, RZ
  hEff_S3RZ= new HEff1DHit("S3RZ");         // RecHits, 3. step, RZ

  hEff_S1RZ_W0= new HEff1DHit("S1RZ_W0");   // RecHits, 1. step, RZ, wheel 0
  hEff_S2RZ_W0= new HEff1DHit("S2RZ_W0");   // RecHits, 2. step, RZ, wheel 0
  hEff_S3RZ_W0= new HEff1DHit("S3RZ_W0");   // RecHits, 3. step, RZ, wheel 0

  hEff_S1RZ_W1= new HEff1DHit("S1RZ_W1");   // RecHits, 1. step, RZ, wheel +-1
  hEff_S2RZ_W1= new HEff1DHit("S2RZ_W1");   // RecHits, 2. step, RZ, wheel +-1
  hEff_S3RZ_W1= new HEff1DHit("S3RZ_W1");   // RecHits, 3. step, RZ, wheel +-1

  hEff_S1RZ_W2= new HEff1DHit("S1RZ_W2");   // RecHits, 1. step, RZ, wheel +-2
  hEff_S2RZ_W2= new HEff1DHit("S2RZ_W2");   // RecHits, 2. step, RZ, wheel +-2
  hEff_S3RZ_W2= new HEff1DHit("S3RZ_W2");   // RecHits, 3. step, RZ, wheel +-2
}
DTRecHitQuality::~DTRecHitQuality ( ) [virtual]

Destructor.

Definition at line 103 of file DTRecHitQuality.cc.

                                   {
  }

Member Function Documentation

void DTRecHitQuality::analyze ( const edm::Event event,
const edm::EventSetup eventSetup 
) [virtual]

Perform the real analysis.

Implements edm::EDAnalyzer.

Definition at line 178 of file DTRecHitQuality.cc.

References bookConverter::compute(), gather_cfg::cout, debug, edm::EventSetup::get(), DTHitQualityUtils::mapSimHitsPerWire(), edm::ESHandle< T >::product(), edm::Handle< T >::product(), trackerHits::simHits, and interactiveExample::theFile.

                                                                                {
    if(debug)
      cout << "--- [DTRecHitQuality] Analysing Event: #Run: " << event.id().run()
        << " #Event: " << event.id().event() << endl;
    theFile->cd();
    // Get the DT Geometry
    ESHandle<DTGeometry> dtGeom;
    eventSetup.get<MuonGeometryRecord>().get(dtGeom);


    // Get the SimHit collection from the event
    Handle<PSimHitContainer> simHits;
    event.getByLabel(simHitLabel, "MuonDTHits", simHits);

    // Map simhits per wire
    map<DTWireId, PSimHitContainer > simHitsPerWire =
      DTHitQualityUtils::mapSimHitsPerWire(*(simHits.product()));




    //=======================================================================================
    // RecHit analysis at Step 1
    if(doStep1) {
      if(debug)
        cout << "  -- DTRecHit S1: begin analysis:" << endl;
      // Get the rechit collection from the event
      Handle<DTRecHitCollection> dtRecHits;
      event.getByLabel(recHitLabel, dtRecHits);

      // Map rechits per wire
      map<DTWireId,vector<DTRecHit1DPair> > recHitsPerWire = 
        map1DRecHitsPerWire(dtRecHits.product());

      compute(dtGeom.product(), simHitsPerWire, recHitsPerWire, 1);
    }



    //=======================================================================================
    // RecHit analysis at Step 2
    if(doStep2) {
      if(debug)
        cout << "  -- DTRecHit S2: begin analysis:" << endl;

      // Get the 2D rechits from the event
      Handle<DTRecSegment2DCollection> segment2Ds;
      event.getByLabel(segment2DLabel, segment2Ds);

      // Map rechits per wire
      map<DTWireId,vector<DTRecHit1D> > recHitsPerWire = 
        map1DRecHitsPerWire(segment2Ds.product());

      compute(dtGeom.product(), simHitsPerWire, recHitsPerWire, 2);
    }


    //=======================================================================================
    // RecHit analysis at Step 3
    if(doStep3) {
      if(debug)
        cout << "  -- DTRecHit S3: begin analysis:" << endl;

      // Get the 4D rechits from the event
      Handle<DTRecSegment4DCollection> segment4Ds;
      event.getByLabel(segment4DLabel, segment4Ds);

      // Map rechits per wire
      map<DTWireId,vector<DTRecHit1D> > recHitsPerWire = 
        map1DRecHitsPerWire(segment4Ds.product());

      compute(dtGeom.product(), simHitsPerWire, recHitsPerWire, 3);
    }

  }
template<typename type >
void DTRecHitQuality::compute ( const DTGeometry dtGeom,
std::map< DTWireId, std::vector< PSimHit > >  simHitsPerWire,
std::map< DTWireId, std::vector< type > >  recHitsPerWire,
int  step 
) [private]

Definition at line 396 of file DTRecHitQuality.cc.

References abs, gather_cfg::cout, debug, PV3DBase< T, PVType, FrameType >::eta(), HRes1DHit::Fill(), HEff1DHit::Fill(), DTHitQualityUtils::findMuSimHit(), DTGeometry::layer(), PSimHit::localPosition(), PV3DBase< T, PVType, FrameType >::phi(), DTSuperLayerId::superLayer(), DTSuperLayerId::superlayer(), GeomDet::toGlobal(), and DTChamberId::wheel().

                                        {
  // Loop over cells with a muon SimHit
  for(map<DTWireId, vector<PSimHit> >::const_iterator wireAndSHits = simHitsPerWire.begin();
      wireAndSHits != simHitsPerWire.end();
      wireAndSHits++) {
    DTWireId wireId = (*wireAndSHits).first;
    vector<PSimHit> simHitsInCell = (*wireAndSHits).second;

    // Get the layer
    const DTLayer* layer = dtGeom->layer(wireId);

    // Look for a mu hit in the cell
    const PSimHit* muSimHit = DTHitQualityUtils::findMuSimHit(simHitsInCell);
    if (muSimHit==0) {
      if (debug) 
        cout << "   No mu SimHit in channel: " << wireId << ", skipping! " << endl;
      continue; // Skip this cell
    }

    // Find the distance of the simhit from the wire
    float simHitWireDist = simHitDistFromWire(layer, wireId, *muSimHit);
    // Skip simhits out of the cell
    if(simHitWireDist>2.1) {
      if(debug) 
        cout << "  [DTRecHitQuality]###Warning: The mu SimHit in out of the cell, skipping!" << endl;
      continue; // Skip this cell
    }
    GlobalPoint simHitGlobalPos = layer->toGlobal(muSimHit->localPosition());

    // find SH impact angle
    float simHitTheta = simHitImpactAngle(layer, wireId, *muSimHit);

    // find SH distance from FE
    float simHitFEDist = simHitDistFromFE(layer, wireId, *muSimHit);

    bool recHitReconstructed = false;

    // Look for RecHits in the same cell
    if(recHitsPerWire.find(wireId) == recHitsPerWire.end()) {
      // No RecHit found in this cell
      if(debug)
        cout << "   No RecHit found at Step: " << step << " in cell: " << wireId << endl;
    } else {
      recHitReconstructed = true;
      // vector<type> recHits = (*wireAndRecHits).second;
      vector<type> recHits = recHitsPerWire[wireId];
      if(debug)
        cout << "   " << recHits.size() << " RecHits, Step " << step << " in channel: " << wireId << endl;

      // Find the best RecHit
      const type* theBestRecHit = findBestRecHit(layer, wireId, recHits, simHitWireDist);


      float recHitWireDist =  recHitDistFromWire(*theBestRecHit, layer);
      if(debug)
        cout << "    SimHit distance from wire: " << simHitWireDist << endl
          << "    SimHit distance from FE: " << simHitFEDist << endl
          << "    SimHit distance angle " << simHitTheta << endl
          << "    RecHit distance from wire: " << recHitWireDist << endl;
      float recHitErr = recHitPositionError(*theBestRecHit);

      HRes1DHit *hRes = 0;
      HRes1DHit *hResTot = 0;

      // Fill residuals and pulls
      // Select the histo to be filled
      if(step == 1) {
        // Step 1
        if(wireId.superLayer() != 2) {
          hRes = hRes_S1RPhi;
        } else {
          hResTot = hRes_S1RZ;
          if(wireId.wheel() == 0)
            hRes = hRes_S1RZ_W0;
          if(abs(wireId.wheel()) == 1)
            hRes = hRes_S1RZ_W1;
          if(abs(wireId.wheel()) == 2)
            hRes = hRes_S1RZ_W2;
        }

      } else if(step == 2) {
        // Step 2
        if(wireId.superlayer() != 2) {
          hRes = hRes_S2RPhi;
        } else {
          hResTot = hRes_S2RZ;
          if(wireId.wheel() == 0)
            hRes = hRes_S2RZ_W0;
          if(abs(wireId.wheel()) == 1)
            hRes = hRes_S2RZ_W1;
          if(abs(wireId.wheel()) == 2)
            hRes = hRes_S2RZ_W2;
        }

      } else if(step == 3) {
        // Step 3
        if(wireId.superlayer() != 2) {
          hRes = hRes_S3RPhi;
        } else {
          hResTot = hRes_S3RZ;
          if(wireId.wheel() == 0)
            hRes = hRes_S3RZ_W0;
          if(abs(wireId.wheel()) == 1)
            hRes = hRes_S3RZ_W1;
          if(abs(wireId.wheel()) == 2)
            hRes = hRes_S3RZ_W2;
        }

      }
      // Fill
      hRes->Fill(simHitWireDist, simHitTheta, simHitFEDist, recHitWireDist, simHitGlobalPos.eta(),
                 simHitGlobalPos.phi(),recHitErr);
      if(hResTot != 0)
        hResTot->Fill(simHitWireDist, simHitTheta, simHitFEDist, recHitWireDist, simHitGlobalPos.eta(),
                      simHitGlobalPos.phi(),recHitErr);

    }

    // Fill Efficiencies
    HEff1DHit *hEff = 0;
    HEff1DHit *hEffTot = 0;

    if(step == 1) {
      // Step 1
      if(wireId.superlayer() != 2) {
        hEff = hEff_S1RPhi;
      } else {
        hEffTot = hEff_S1RZ;
        if(wireId.wheel() == 0)
          hEff = hEff_S1RZ_W0;
        if(abs(wireId.wheel()) == 1)
          hEff = hEff_S1RZ_W1;
        if(abs(wireId.wheel()) == 2)
          hEff = hEff_S1RZ_W2;
      }

    } else if(step == 2) {
      // Step 2
      if(wireId.superlayer() != 2) {
        hEff = hEff_S2RPhi;
      } else {
        hEffTot = hEff_S2RZ;
        if(wireId.wheel() == 0)
          hEff = hEff_S2RZ_W0;
        if(abs(wireId.wheel()) == 1)
          hEff = hEff_S2RZ_W1;
        if(abs(wireId.wheel()) == 2)
          hEff = hEff_S2RZ_W2;
      }

    } else if(step == 3) {
      // Step 3
      if(wireId.superlayer() != 2) {
        hEff = hEff_S3RPhi;
      } else {
        hEffTot = hEff_S3RZ;
        if(wireId.wheel() == 0)
          hEff = hEff_S3RZ_W0;
        if(abs(wireId.wheel()) == 1)
          hEff = hEff_S3RZ_W1;
        if(abs(wireId.wheel()) == 2)
          hEff = hEff_S3RZ_W2;
      }

    }
    // Fill
    hEff->Fill(simHitWireDist, simHitGlobalPos.eta(), simHitGlobalPos.phi(), recHitReconstructed);
    if(hEffTot != 0)
      hEffTot->Fill(simHitWireDist, simHitGlobalPos.eta(), simHitGlobalPos.phi(), recHitReconstructed);
  }
}
void DTRecHitQuality::endJob ( void  ) [virtual]
template<typename type >
const type* DTRecHitQuality::findBestRecHit ( const DTLayer layer,
DTWireId  wireId,
const std::vector< type > &  recHits,
const float  simHitDist 
) [private]
template<typename type >
const type* DTRecHitQuality::findBestRecHit ( const DTLayer layer,
DTWireId  wireId,
const vector< type > &  recHits,
const float  simHitDist 
)

Definition at line 357 of file DTRecHitQuality.cc.

                                                        {
  float res = 99999;
  const type* theBestRecHit = 0;
  // Loop over RecHits within the cell
  for(typename vector<type>::const_iterator recHit = recHits.begin();
      recHit != recHits.end();
      recHit++) {
    float distTmp = recHitDistFromWire(*recHit, layer);
    if(fabs(distTmp-simHitDist) < res) {
      res = fabs(distTmp-simHitDist);
      theBestRecHit = &(*recHit);
    }
  } // End of loop over RecHits within the cell

  return theBestRecHit;
}
map< DTWireId, vector< DTRecHit1D > > DTRecHitQuality::map1DRecHitsPerWire ( const DTRecSegment2DCollection segment2Ds) [private]

Definition at line 272 of file DTRecHitQuality.cc.

References runTheMatrix::ret.

                                                                               {
  map<DTWireId, vector<DTRecHit1D> > ret;

  // Loop over all 2D segments
  for(DTRecSegment2DCollection::const_iterator segment = segment2Ds->begin();
      segment != segment2Ds->end();
      segment++) {
    vector<DTRecHit1D> component1DHits= (*segment).specificRecHits();
    // Loop over all component 1D hits
    for(vector<DTRecHit1D>::const_iterator hit = component1DHits.begin();
        hit != component1DHits.end();
        hit++) {
      ret[(*hit).wireId()].push_back(*hit);
    }
  }
  return ret;
}
map< DTWireId, std::vector< DTRecHit1D > > DTRecHitQuality::map1DRecHitsPerWire ( const DTRecSegment4DCollection segment4Ds) [private]

Definition at line 294 of file DTRecHitQuality.cc.

References runTheMatrix::ret, and DTRecHit1D::wireId().

                                                                               {
  map<DTWireId, vector<DTRecHit1D> > ret;
  // Loop over all 4D segments
  for(DTRecSegment4DCollection::const_iterator segment = segment4Ds->begin();
      segment != segment4Ds->end();
      segment++) {
    // Get component 2D segments
    vector<const TrackingRecHit*> segment2Ds = (*segment).recHits();
    // Loop over 2D segments:
    for(vector<const TrackingRecHit*>::const_iterator segment2D = segment2Ds.begin();
        segment2D != segment2Ds.end();
        segment2D++) {
      // Get 1D component rechits
      vector<const TrackingRecHit*> hits = (*segment2D)->recHits();
      // Loop over them
      for(vector<const TrackingRecHit*>::const_iterator hit = hits.begin();
          hit != hits.end(); hit++) {
        const DTRecHit1D* hit1D = dynamic_cast<const DTRecHit1D*>(*hit);
        ret[hit1D->wireId()].push_back(*hit1D);
      }
    }
  }

  return ret;
}
map< DTWireId, vector< DTRecHit1DPair > > DTRecHitQuality::map1DRecHitsPerWire ( const DTRecHitCollection dt1DRecHitPairs) [private]

Definition at line 258 of file DTRecHitQuality.cc.

References runTheMatrix::ret.

                                                                              {
  map<DTWireId, vector<DTRecHit1DPair> > ret;

  for(DTRecHitCollection::const_iterator rechit = dt1DRecHitPairs->begin();
      rechit != dt1DRecHitPairs->end(); rechit++) {
    ret[(*rechit).wireId()].push_back(*rechit);
  }

  return ret;
}
float DTRecHitQuality::recHitDistFromWire ( const DTRecHit1DPair hitPair,
const DTLayer layer 
) [private]

Definition at line 380 of file DTRecHitQuality.cc.

References DTEnums::Left, DTRecHit1DPair::localPosition(), DTEnums::Right, and PV3DBase< T, PVType, FrameType >::x().

                                                                                       {
  // Compute the rechit distance from wire
  return fabs(hitPair.localPosition(DTEnums::Left).x() -
              hitPair.localPosition(DTEnums::Right).x())/2.;
}
float DTRecHitQuality::recHitDistFromWire ( const DTRecHit1D recHit,
const DTLayer layer 
) [private]
float DTRecHitQuality::recHitPositionError ( const DTRecHit1D recHit) [private]

Definition at line 577 of file DTRecHitQuality.cc.

References DTRecHit1D::localPositionError(), mathSSE::sqrt(), and LocalError::xx().

                                                                   {
  return sqrt(recHit.localPositionError().xx());
}
float DTRecHitQuality::recHitPositionError ( const DTRecHit1DPair recHit) [private]
float DTRecHitQuality::simHitDistFromFE ( const DTLayer layer,
DTWireId  wireId,
const PSimHit hit 
) [private]

Definition at line 344 of file DTRecHitQuality.cc.

References DTTopology::cellLenght(), PSimHit::entryPoint(), PSimHit::exitPoint(), DTLayer::specificTopology(), and PV3DBase< T, PVType, FrameType >::y().

                                                            {
  LocalPoint entryP = hit.entryPoint();
  LocalPoint exitP = hit.exitPoint();
  float wireLenght=layer->specificTopology().cellLenght();
  return (entryP.y()+exitP.y())/2.+wireLenght;
}
float DTRecHitQuality::simHitDistFromWire ( const DTLayer layer,
DTWireId  wireId,
const PSimHit hit 
) [private]

Definition at line 321 of file DTRecHitQuality.cc.

References PSimHit::entryPoint(), PSimHit::exitPoint(), DTLayer::specificTopology(), DTWireId::wire(), DTTopology::wirePosition(), PV3DBase< T, PVType, FrameType >::x(), and PV3DBase< T, PVType, FrameType >::z().

                                                              {
  float xwire = layer->specificTopology().wirePosition(wireId.wire());
  LocalPoint entryP = hit.entryPoint();
  LocalPoint exitP = hit.exitPoint();
  float xEntry = entryP.x()-xwire;
  float xExit  = exitP.x()-xwire;

  return fabs(xEntry - (entryP.z()*(xExit-xEntry))/(exitP.z()-entryP.z()));//FIXME: check...
}
float DTRecHitQuality::simHitImpactAngle ( const DTLayer layer,
DTWireId  wireId,
const PSimHit hit 
) [private]

Definition at line 334 of file DTRecHitQuality.cc.

References PSimHit::entryPoint(), PSimHit::exitPoint(), theta(), PV3DBase< T, PVType, FrameType >::x(), and PV3DBase< T, PVType, FrameType >::z().

                                                             {
  LocalPoint entryP = hit.entryPoint();
  LocalPoint exitP = hit.exitPoint();
  float theta=(exitP.x()-entryP.x())/(exitP.z()-entryP.z());
  return atan(theta);
}

Member Data Documentation

bool DTRecHitQuality::debug [private]

Definition at line 62 of file DTRecHitQuality.h.

bool DTRecHitQuality::doStep1 [private]

Definition at line 71 of file DTRecHitQuality.h.

bool DTRecHitQuality::doStep2 [private]

Definition at line 72 of file DTRecHitQuality.h.

bool DTRecHitQuality::doStep3 [private]

Definition at line 73 of file DTRecHitQuality.h.

Definition at line 156 of file DTRecHitQuality.h.

Definition at line 160 of file DTRecHitQuality.h.

Definition at line 164 of file DTRecHitQuality.h.

Definition at line 168 of file DTRecHitQuality.h.

Definition at line 172 of file DTRecHitQuality.h.

Definition at line 157 of file DTRecHitQuality.h.

Definition at line 161 of file DTRecHitQuality.h.

Definition at line 165 of file DTRecHitQuality.h.

Definition at line 169 of file DTRecHitQuality.h.

Definition at line 173 of file DTRecHitQuality.h.

Definition at line 158 of file DTRecHitQuality.h.

Definition at line 162 of file DTRecHitQuality.h.

Definition at line 166 of file DTRecHitQuality.h.

Definition at line 170 of file DTRecHitQuality.h.

Definition at line 174 of file DTRecHitQuality.h.

Definition at line 135 of file DTRecHitQuality.h.

Definition at line 139 of file DTRecHitQuality.h.

Definition at line 143 of file DTRecHitQuality.h.

Definition at line 147 of file DTRecHitQuality.h.

Definition at line 151 of file DTRecHitQuality.h.

Definition at line 136 of file DTRecHitQuality.h.

Definition at line 140 of file DTRecHitQuality.h.

Definition at line 144 of file DTRecHitQuality.h.

Definition at line 148 of file DTRecHitQuality.h.

Definition at line 152 of file DTRecHitQuality.h.

Definition at line 137 of file DTRecHitQuality.h.

Definition at line 141 of file DTRecHitQuality.h.

Definition at line 145 of file DTRecHitQuality.h.

Definition at line 149 of file DTRecHitQuality.h.

Definition at line 153 of file DTRecHitQuality.h.

std::string DTRecHitQuality::recHitLabel [private]

Definition at line 66 of file DTRecHitQuality.h.

std::string DTRecHitQuality::rootFileName [private]

Definition at line 64 of file DTRecHitQuality.h.

std::string DTRecHitQuality::segment2DLabel [private]

Definition at line 67 of file DTRecHitQuality.h.

std::string DTRecHitQuality::segment4DLabel [private]

Definition at line 68 of file DTRecHitQuality.h.

std::string DTRecHitQuality::simHitLabel [private]

Definition at line 65 of file DTRecHitQuality.h.

TFile* DTRecHitQuality::theFile [private]

Definition at line 60 of file DTRecHitQuality.h.