CMS 3D CMS Logo

Public Member Functions | Private Attributes

HTrack Class Reference

#include <HTrack.h>

List of all members.

Public Member Functions

double computeEfficiency (HTrackVariables *sim)
void computePull (FreeTrajectoryState &fts, SimTrack &simTracks, HResolution *hReso)
void computeResolution (FreeTrajectoryState &fts, SimTrack &simTracks, HResolution *hReso)
void computeResolutionAndPull (FreeTrajectoryState &fts, SimTrack &simTrack)
void computeResolutionAndPull (TrajectoryStateOnSurface &vtx, SimTrack &simTrack)
void computeTDRResolution (FreeTrajectoryState &fts, SimTrack &simTracks, HResolution *hReso)
void Fill (TrajectoryStateOnSurface &)
void Fill (FreeTrajectoryState &)
void FillDeltaR (double)
 HTrack (std::string, std::string name, std::string whereIs="")
double pull (double rec, double sim, double sigmarec)
double resolution (double rec, double sim)

Private Attributes

DQMStoredbe_
bool doSubHisto
HResolutionhPull
HResolutionhPull_08
HResolutionhPull_08_12
HResolutionhPull_10_40
HResolutionhPull_12_21
HResolutionhPull_12_21_minus
HResolutionhPull_12_21_plus
HResolutionhPull_12_24
HResolutionhPull_12_24_minus
HResolutionhPull_12_24_plus
HResolutionhPull_40_70
HResolutionhPull_5_10
HResolutionhPull_70_100
HResolutionhResolution
HResolutionhResolution_08
HResolutionhResolution_08_12
HResolutionhResolution_10_40
HResolutionhResolution_12_21
HResolutionhResolution_12_21_minus
HResolutionhResolution_12_21_plus
HResolutionhResolution_12_24
HResolutionhResolution_12_24_minus
HResolutionhResolution_12_24_plus
HResolutionhResolution_40_70
HResolutionhResolution_5_10
HResolutionhResolution_70_100
HResolutionhTDRPull
HResolutionhTDRResolution
HResolutionhTDRResolution_08
HResolutionhTDRResolution_08_12
HResolutionhTDRResolution_10_40
HResolutionhTDRResolution_12_21
HResolutionhTDRResolution_12_21_minus
HResolutionhTDRResolution_12_21_plus
HResolutionhTDRResolution_12_24
HResolutionhTDRResolution_12_24_minus
HResolutionhTDRResolution_12_24_plus
HResolutionhTDRResolution_40_70
HResolutionhTDRResolution_5_10
HResolutionhTDRResolution_70_100
HTrackVariableshVariables
TString theName
TString where

Detailed Description

Definition at line 12 of file HTrack.h.


Constructor & Destructor Documentation

HTrack::HTrack ( std::string  ,
std::string  name,
std::string  whereIs = "" 
)

Definition at line 17 of file HTrack.cc.

References DQMStore::cd(), dbe_, TrackerOfflineValidation_Dqm_cff::dirName, doSubHisto, hPull, hPull_08, hPull_08_12, hPull_10_40, hPull_12_21, hPull_12_21_minus, hPull_12_21_plus, hPull_12_24, hPull_12_24_minus, hPull_12_24_plus, hPull_40_70, hPull_5_10, hPull_70_100, hResolution, hResolution_08, hResolution_08_12, hResolution_10_40, hResolution_12_21, hResolution_12_21_minus, hResolution_12_21_plus, hResolution_12_24, hResolution_12_24_minus, hResolution_12_24_plus, hResolution_40_70, hResolution_5_10, hResolution_70_100, hTDRPull, hTDRResolution, hTDRResolution_08, hTDRResolution_08_12, hTDRResolution_10_40, hTDRResolution_12_21, hTDRResolution_12_21_minus, hTDRResolution_12_21_plus, hTDRResolution_12_24, hTDRResolution_12_24_minus, hTDRResolution_12_24_plus, hTDRResolution_40_70, hTDRResolution_5_10, hTDRResolution_70_100, hVariables, mergeVDriftHistosByStation::name, cppFunctionSkipper::operator, and DQMStore::setCurrentFolder().

                                                        :
  theName(name.c_str()),where(whereIs.c_str()){

  dbe_ = edm::Service<DQMStore>().operator->();
  dbe_->cd();
  std::string dirName=dirName_;
  dirName+="/";
  dirName+=name.c_str();
  dirName+="_";
  dirName+=whereIs.c_str();

  dbe_->cd();
  dbe_->setCurrentFolder(dirName.c_str());
  
  hVariables = new HTrackVariables(dirName.c_str(),name,whereIs);


  dbe_->cd();
  dbe_->setCurrentFolder(dirName.c_str());
  string resName = dirName;
  resName+="/Resolution";
  hResolution = new HResolution(resName.c_str(),name+"_Res",whereIs);
  dbe_->cd();
  dbe_->setCurrentFolder(dirName.c_str());
  hTDRResolution = new HResolution(resName.c_str(),name+"_TDRRes",whereIs);

  dbe_->cd();
  dbe_->setCurrentFolder(dirName.c_str());
  string pullName = dirName;
  pullName+="/Pull";
  hPull = new HResolution(pullName.c_str(),name+"_Pull",whereIs);
  hTDRPull = new HResolution(pullName.c_str(),name+"_TDRPull",whereIs);
  
  
  doSubHisto = false;

  if(doSubHisto){
    dbe_->cd();
    dbe_->setCurrentFolder(dirName.c_str());
    string subName = dirName;
    subName+="/subHistos";
    // [5-10] GeV range
    hResolution_5_10 = new HResolution(subName.c_str(),name+"_Res_Pt_5_10",whereIs);
    hTDRResolution_5_10 = new HResolution(subName.c_str(),name+"_TDRRes_Pt_5_10",whereIs);
    hPull_5_10 = new HResolution(subName.c_str(),name+"_Pull_Pt_5_10",whereIs);
    
    
    hResolution_10_40 = new HResolution(subName.c_str(),name+"_Res_Pt_10_40",whereIs);
    hTDRResolution_10_40 = new HResolution(subName.c_str(),name+"_TDRRes_Pt_10_40",whereIs);
    hPull_10_40 = new HResolution(subName.c_str(),name+"_Pull_Pt_10_40",whereIs);
    
    
    hResolution_40_70 = new HResolution(subName.c_str(),name+"_Res_Pt_40_70",whereIs);
    hTDRResolution_40_70 = new HResolution(subName.c_str(),name+"_TDRRes_Pt_40_70",whereIs);
    hPull_40_70 = new HResolution(subName.c_str(),name+"_Pull_Pt_40_70",whereIs);
    
    
    hResolution_70_100 = new HResolution(subName.c_str(),name+"_Res_Pt_70_100",whereIs);
    hTDRResolution_70_100 = new HResolution(subName.c_str(),name+"_TDRRes_Pt_70_100",whereIs);
    hPull_70_100 = new HResolution(subName.c_str(),name+"_Pull_Pt_70_100",whereIs);
    
    
    hResolution_08 = new HResolution(subName.c_str(),name+"_Res_Eta_08",whereIs);
    hTDRResolution_08 = new HResolution(subName.c_str(),name+"_TDRRes_Eta_08",whereIs);
    hPull_08 = new HResolution(subName.c_str(),name+"_Pull_Eta_08",whereIs);
    
        
    hResolution_08_12 = new HResolution(subName.c_str(),name+"_Res_Eta_08_12",whereIs);
    hTDRResolution_08_12 = new HResolution(subName.c_str(),name+"_TDRRes_Eta_08_12",whereIs);
    hPull_08_12 = new HResolution(subName.c_str(),name+"_Pull_Eta_08_12",whereIs);
    
    
    hResolution_12_21 = new HResolution(subName.c_str(),name+"_Res_Eta_12_21",whereIs);
    hTDRResolution_12_21 = new HResolution(subName.c_str(),name+"_TDRRes_Eta_12_21",whereIs);
    hPull_12_21 = new HResolution(subName.c_str(),name+"_Pull_Eta_12_21",whereIs);
    
    
    hResolution_12_24 = new HResolution(subName.c_str(),name+"_Res_Eta_12_24",whereIs);
    hTDRResolution_12_24 = new HResolution(subName.c_str(),name+"_TDRRes_Eta_12_24",whereIs);
    hPull_12_24 = new HResolution(subName.c_str(),name+"_Pull_Eta_12_24",whereIs);

    
    hResolution_12_21_plus = new HResolution(subName.c_str(),name+"_Res_Eta_12_21_plus",whereIs);
    hTDRResolution_12_21_plus = new HResolution(subName.c_str(),name+"_TDRRes_Eta_12_21_plus",whereIs);
    hPull_12_21_plus = new HResolution(subName.c_str(),name+"_Pull_Eta_12_21_plus",whereIs);
    
    
    hResolution_12_24_plus = new HResolution(subName.c_str(),name+"_Res_Eta_12_24_plus",whereIs);
    hTDRResolution_12_24_plus = new HResolution(subName.c_str(),name+"_TDRRes_Eta_12_24_plus",whereIs);
    hPull_12_24_plus = new HResolution(subName.c_str(),name+"_Pull_Eta_12_24_plus",whereIs);
    
    
    hResolution_12_21_minus = new HResolution(subName.c_str(),name+"_Res_Eta_12_21_minus",whereIs);
    hTDRResolution_12_21_minus = new HResolution(subName.c_str(),name+"_TDRRes_Eta_12_21_minus",whereIs);
    hPull_12_21_minus = new HResolution(subName.c_str(),name+"_Pull_Eta_12_21_minus",whereIs);
    
    
    hResolution_12_24_minus = new HResolution(subName.c_str(),name+"_Res_Eta_12_24_minus",whereIs);
    hTDRResolution_12_24_minus = new HResolution(subName.c_str(),name+"_TDRRes_Eta_12_24_minus",whereIs);
    hPull_12_24_minus = new HResolution(subName.c_str(),name+"_Pull_Eta_12_24_minus",whereIs);
  }
}

Member Function Documentation

double HTrack::computeEfficiency ( HTrackVariables sim)

Definition at line 372 of file DQMGenericClient.cc.

References i, and mathSSE::sqrt().

{
  if ( ! theDQM->dirExists(startDir) ) {
    if ( verbose_ >= 2 || (verbose_ == 1 && !isWildcardUsed_) ) {
      LogInfo("DQMGenericClient") << "computeEfficiency() : "
                                  << "Cannot find sub-directory " << startDir << endl; 
    }
    return;
  }

  theDQM->cd();

  ME* simME  = theDQM->get(startDir+"/"+simMEName);
  ME* recoME = theDQM->get(startDir+"/"+recoMEName);

  if ( !simME ) {
    if ( verbose_ >= 2 || (verbose_ == 1 && !isWildcardUsed_) ) {
      LogInfo("DQMGenericClient") << "computeEfficiency() : "
                                  << "No sim-ME '" << simMEName << "' found\n";
    }
    return;
  }

  if ( !recoME ) {
    if ( verbose_ >= 2 || (verbose_ == 1 && !isWildcardUsed_) ) {
      LogInfo("DQMGenericClient") << "computeEfficiency() : " 
                                  << "No reco-ME '" << recoMEName << "' found\n";
    }
    return;
  }

  // Treat everything as the base class, TH1
  
  TH1* hSim  = simME ->getTH1();
  TH1* hReco = recoME->getTH1();
  
  if ( !hSim || !hReco ) {
    if ( verbose_ >= 2 || (verbose_ == 1 && !isWildcardUsed_) ) {
      LogInfo("DQMGenericClient") << "computeEfficiency() : "
                                  << "Cannot create TH1 from ME\n";
    }
    return;
  }

  string efficDir = startDir;
  string newEfficMEName = efficMEName;
  string::size_type shiftPos;
  if ( string::npos != (shiftPos = efficMEName.rfind('/')) ) {
    efficDir += "/"+efficMEName.substr(0, shiftPos);
    newEfficMEName.erase(0, shiftPos+1);
  }
  theDQM->setCurrentFolder(efficDir);

  if (makeProfile) {
    TProfile * efficHist = (hReco->GetXaxis()->GetXbins()->GetSize()==0) ?
      new TProfile(newEfficMEName.c_str(), efficMETitle.c_str(),
                   hReco->GetXaxis()->GetNbins(),
                   hReco->GetXaxis()->GetXmin(),
                   hReco->GetXaxis()->GetXmax()) :
      new TProfile(newEfficMEName.c_str(), efficMETitle.c_str(),
                   hReco->GetXaxis()->GetNbins(),
                   hReco->GetXaxis()->GetXbins()->GetArray());
#if ROOT_VERSION_CODE >= ROOT_VERSION(5,27,0)
    for (int i=1; i <= hReco->GetNbinsX(); i++) {
      const double nReco = hReco->GetBinContent(i);
      const double nSim = hSim->GetBinContent(i);
    
      if ( nSim == 0 || nReco > nSim ) continue;
      const double effVal = nReco/nSim;

      const double errLo = TEfficiency::ClopperPearson((int)hSim->GetBinContent(i), 
                                                       (int)hReco->GetBinContent(i),
                                                       0.683,false);
      const double errUp = TEfficiency::ClopperPearson((int)hSim->GetBinContent(i), 
                                                       (int)hReco->GetBinContent(i),
                                                       0.683,true);
      const double errVal = (effVal - errLo > errUp - effVal) ? effVal - errLo : errUp - effVal;
      efficHist->SetBinContent(i, effVal);
      efficHist->SetBinEntries(i, 1);
      efficHist->SetBinError(i, sqrt(effVal * effVal + errVal * errVal));
    }
#else
    for (int i=1; i <= hReco->GetNbinsX(); i++) {
      TGraphAsymmErrorsWrapper asymm;
      std::pair<double, double> efficiencyWithError;
      efficiencyWithError = asymm.efficiency((int)hReco->GetBinContent(i), 
                                             (int)hSim->GetBinContent(i));
      double effVal = efficiencyWithError.first;
      double errVal = efficiencyWithError.second;
      if ((int)hSim->GetBinContent(i) > 0) {
        efficHist->SetBinContent(i, effVal);
        efficHist->SetBinEntries(i, 1);
        efficHist->SetBinError(i, sqrt(effVal * effVal + errVal * errVal));
      }
    }
#endif
    theDQM->bookProfile(newEfficMEName.c_str(),efficHist);
    delete efficHist;  
  }

  else {

    TH1* efficHist = (TH1*)hSim->Clone(newEfficMEName.c_str());
    efficHist->SetTitle(efficMETitle.c_str());

    // Here is where you have trouble --- you need
    // to understand what type of hist you have.

    ME* efficME = 0;

    // Parse the class name
    // This works, but there might be a better way
    TClass * myHistClass = efficHist->IsA();
    TString histClassName = myHistClass->GetName();
  
    if (histClassName == "TH1F"){
      efficME = theDQM->book1D(newEfficMEName, (TH1F*)efficHist);
    } else if (histClassName == "TH2F"){
      efficME = theDQM->book2D(newEfficMEName, (TH2F*)efficHist);    
    } else if (histClassName == "TH3F"){
      efficME = theDQM->book3D(newEfficMEName, (TH3F*)efficHist);    
    } 
  

    if ( !efficME ) {
      LogInfo("DQMGenericClient") << "computeEfficiency() : "
                                  << "Cannot book effic-ME from the DQM\n";
      return;
    }

    // Update: 2009-9-16 slaunwhj
    // call the most generic efficiency function
    // works up to 3-d histograms

    generic_eff (hSim, hReco, efficME, type);
  
    //   const int nBin = efficME->getNbinsX();
    //   for(int bin = 0; bin <= nBin; ++bin) {
    //     const float nSim  = simME ->getBinContent(bin);
    //     const float nReco = recoME->getBinContent(bin);
    //     float eff =0;
    //     if (type=="fake")eff = nSim ? 1-nReco/nSim : 0.;
    //     else eff= nSim ? nReco/nSim : 0.;
    //     const float err = nSim && eff <= 1 ? sqrt(eff*(1-eff)/nSim) : 0.;
    //     efficME->setBinContent(bin, eff);
    //     efficME->setBinError(bin, err);
    //   }
    efficME->setEntries(simME->getEntries());

  }

  // Global efficiency
  ME* globalEfficME = theDQM->get(efficDir+"/globalEfficiencies");
  if ( !globalEfficME ) globalEfficME = theDQM->book1D("globalEfficiencies", "Global efficiencies", 1, 0, 1);
  if ( !globalEfficME ) {
    LogInfo("DQMGenericClient") << "computeEfficiency() : "
                              << "Cannot book globalEffic-ME from the DQM\n";
    return;
  }
  TH1F* hGlobalEffic = globalEfficME->getTH1F();
  if ( !hGlobalEffic ) {
    LogInfo("DQMGenericClient") << "computeEfficiency() : "
                              << "Cannot create TH1F from ME, globalEfficME\n";
    return;
  }

  const float nSimAll = hSim->GetEntries();
  const float nRecoAll = hReco->GetEntries();
  float efficAll=0; 
  if ( type == 1 ) efficAll = nSimAll ? nRecoAll/nSimAll : 0;
  else if ( type == 2 ) efficAll = nSimAll ? 1-nRecoAll/nSimAll : 0;
  const float errorAll = nSimAll && efficAll < 1 ? sqrt(efficAll*(1-efficAll)/nSimAll) : 0;

  const int iBin = hGlobalEffic->Fill(newEfficMEName.c_str(), 0);
  hGlobalEffic->SetBinContent(iBin, efficAll);
  hGlobalEffic->SetBinError(iBin, errorAll);
}
void HTrack::computePull ( FreeTrajectoryState fts,
SimTrack simTracks,
HResolution hReso 
)

Definition at line 288 of file HTrack.cc.

References abs, FreeTrajectoryState::cartesianError(), FreeTrajectoryState::charge(), FreeTrajectoryState::curvilinearError(), benchmark_cfg::errors, PV3DBase< T, PVType, FrameType >::eta(), HResolution::Fill(), PV3DBase< T, PVType, FrameType >::mag(), CartesianTrajectoryError::matrix(), CurvilinearTrajectoryError::matrix(), CoreSimTrack::momentum(), FreeTrajectoryState::momentum(), PV3DBase< T, PVType, FrameType >::perp(), PV3DBase< T, PVType, FrameType >::phi(), funct::pow(), pull(), funct::sin(), mathSSE::sqrt(), PV3DBase< T, PVType, FrameType >::theta(), CoreSimTrack::type(), PV3DBase< T, PVType, FrameType >::x(), PV3DBase< T, PVType, FrameType >::y(), and PV3DBase< T, PVType, FrameType >::z().

Referenced by computeResolutionAndPull().

                                            {

  // x,y,z, px,py,pz
  AlgebraicSymMatrix66 const & errors = fts.cartesianError().matrix();
  
  double partialPterror = errors[3][3]*pow(fts.momentum().x(),2) + errors[4][4]*pow(fts.momentum().y(),2);
  
  // sqrt( (px*spx)^2 + (py*spy)^2 ) / pt
  double pterror = sqrt(partialPterror)/fts.momentum().perp();
  
  // sqrt( (px*spx)^2 + (py*spy)^2 + (pz*spz)^2 ) / p
  double perror = sqrt(partialPterror+errors[5][5]*pow(fts.momentum().z(),2))/fts.momentum().mag();

  double phierror = sqrt(fts.curvilinearError().matrix()[2][2]);

  double etaerror = sqrt(fts.curvilinearError().matrix()[1][1])*abs(sin(fts.momentum().theta()));


  hReso->Fill(simTrack.momentum().mag(),
              sqrt(simTrack.momentum().Perp2()),
              simTrack.momentum().eta(),
              simTrack.momentum().phi(),
              pull(fts.momentum().mag(),simTrack.momentum().mag(),perror),
              pull(fts.momentum().perp(),sqrt(simTrack.momentum().Perp2()),pterror),
              pull(fts.momentum().eta(),simTrack.momentum().eta(),etaerror),
              pull(fts.momentum().phi(),simTrack.momentum().phi(),phierror),
              pull(fts.charge() , -simTrack.type()/ abs(simTrack.type()), 1.)); // FIXME
}
void HTrack::computeResolution ( FreeTrajectoryState fts,
SimTrack simTracks,
HResolution hReso 
)

Definition at line 255 of file HTrack.cc.

References abs, FreeTrajectoryState::charge(), PV3DBase< T, PVType, FrameType >::eta(), HResolution::Fill(), PV3DBase< T, PVType, FrameType >::mag(), CoreSimTrack::momentum(), FreeTrajectoryState::momentum(), PV3DBase< T, PVType, FrameType >::perp(), PV3DBase< T, PVType, FrameType >::phi(), resolution(), mathSSE::sqrt(), and CoreSimTrack::type().

Referenced by computeResolutionAndPull().

                                                  {


  hReso->Fill(simTrack.momentum().mag(),
              sqrt(simTrack.momentum().Perp2()),
              simTrack.momentum().eta(),
              simTrack.momentum().phi(),
              resolution(fts.momentum().mag(),simTrack.momentum().mag()),
              resolution(fts.momentum().perp(),sqrt(simTrack.momentum().Perp2())),
              fts.momentum().eta()-simTrack.momentum().eta(),
              fts.momentum().phi()-simTrack.momentum().phi(),
              fts.charge()+simTrack.type()/abs(simTrack.type())); // FIXME
}
void HTrack::computeResolutionAndPull ( TrajectoryStateOnSurface vtx,
SimTrack simTrack 
)

Definition at line 152 of file HTrack.cc.

References TrajectoryStateOnSurface::freeState().

Referenced by MuonTrackAnalyzer::fillPlots().

                                                                                       {
  computeResolutionAndPull(*tsos.freeState(),simTrack);
}
void HTrack::computeResolutionAndPull ( FreeTrajectoryState fts,
SimTrack simTrack 
)

Definition at line 157 of file HTrack.cc.

References abs, computePull(), computeResolution(), computeTDRResolution(), doSubHisto, HTrackVariables::Fill(), hPull, hPull_08, hPull_08_12, hPull_10_40, hPull_12_21, hPull_12_21_minus, hPull_12_21_plus, hPull_12_24, hPull_12_24_minus, hPull_12_24_plus, hPull_40_70, hPull_5_10, hPull_70_100, hResolution, hResolution_08, hResolution_08_12, hResolution_10_40, hResolution_12_21, hResolution_12_21_minus, hResolution_12_21_plus, hResolution_12_24, hResolution_12_24_minus, hResolution_12_24_plus, hResolution_40_70, hResolution_5_10, hResolution_70_100, hTDRResolution, hTDRResolution_08, hTDRResolution_08_12, hTDRResolution_10_40, hTDRResolution_12_21, hTDRResolution_12_21_minus, hTDRResolution_12_21_plus, hTDRResolution_12_24, hTDRResolution_12_24_minus, hTDRResolution_12_24_plus, hTDRResolution_40_70, hTDRResolution_5_10, hTDRResolution_70_100, hVariables, CoreSimTrack::momentum(), and mathSSE::sqrt().

                                                                                 {
  

  // Global Resolution
  computeResolution(fts,simTrack,hResolution); 
  computePull(fts,simTrack,hPull); 

  // TDR Resolution
  computeTDRResolution(fts,simTrack,hTDRResolution);
  // computeTDRPull(fts,simTracks,hTDRPull); 


  hVariables->Fill(sqrt(simTrack.momentum().Perp2()),
                   simTrack.momentum().eta(),
                   simTrack.momentum().phi()); //FIXME


  if(doSubHisto){
    // [5-10] GeV range
    if(sqrt(simTrack.momentum().Perp2()) <10 ){  
      computeResolution(fts,simTrack,hResolution_5_10);
      computeTDRResolution(fts,simTrack,hTDRResolution_5_10);
      computePull(fts,simTrack,hPull_5_10);
    }

    // [10-40] GeV range
    if(sqrt(simTrack.momentum().Perp2()) >=10 && sqrt(simTrack.momentum().Perp2()) < 40){
      computeResolution(fts,simTrack,hResolution_10_40); 
      computeTDRResolution(fts,simTrack,  hTDRResolution_10_40);
      computePull(fts,simTrack,hPull_10_40);
    }
  
    // [40-70] GeV range
    if(sqrt(simTrack.momentum().Perp2()) >=40 && sqrt(simTrack.momentum().Perp2()) < 70){
      computeResolution(fts,simTrack,hResolution_40_70); 
      computeTDRResolution(fts,simTrack,hTDRResolution_40_70);
      computePull(fts,simTrack,hPull_40_70); 
    }

    // [70-100] GeV range
    if(sqrt(simTrack.momentum().Perp2()) >= 70 && sqrt(simTrack.momentum().Perp2()) < 100){            
      computeResolution(fts,simTrack,hResolution_70_100); 
      computeTDRResolution(fts,simTrack,hTDRResolution_70_100);
      computePull(fts,simTrack,hPull_70_100); 
    }
  
    // eta range |eta|<0.8
    if(abs(simTrack.momentum().eta()) <= 0.8){
      computeResolution(fts,simTrack,hResolution_08); 
      computeTDRResolution(fts,simTrack,  hTDRResolution_08);
      computePull(fts,simTrack,hPull_08);
    }

    // eta range 0.8<|eta|<1.2
    if( abs(simTrack.momentum().eta()) > 0.8 && abs(simTrack.momentum().eta()) <= 1.2 ){
      computeResolution(fts,simTrack,hResolution_08_12); 
      computeTDRResolution(fts,simTrack,  hTDRResolution_08_12);
      computePull(fts,simTrack,hPull_08_12);
    }

    // eta range 1.2<|eta|<2.1
    if( abs(simTrack.momentum().eta()) > 1.2 && abs(simTrack.momentum().eta()) <= 2.1 ){
      computeResolution(fts,simTrack,hResolution_12_21); 
      computeTDRResolution(fts,simTrack,  hTDRResolution_12_21);
      computePull(fts,simTrack,hPull_12_21);
    
      if(simTrack.momentum().eta() > 0){
        computeResolution(fts,simTrack,hResolution_12_21_plus); 
        computeTDRResolution(fts,simTrack,  hTDRResolution_12_21_plus);
        computePull(fts,simTrack,hPull_12_21_plus);
      }
      else{
        computeResolution(fts,simTrack,hResolution_12_21_minus); 
        computeTDRResolution(fts,simTrack,  hTDRResolution_12_21_minus);
        computePull(fts,simTrack,hPull_12_21_minus);
      }  
    }

    // eta range 1.2<|eta|<2.4
    if( abs(simTrack.momentum().eta()) > 1.2 && abs(simTrack.momentum().eta()) <= 2.4 ){
      computeResolution(fts,simTrack,hResolution_12_24); 
      computeTDRResolution(fts,simTrack,  hTDRResolution_12_24);
      computePull(fts,simTrack,hPull_12_24);

      if(simTrack.momentum().eta() > 0){
        computeResolution(fts,simTrack,hResolution_12_24_plus); 
        computeTDRResolution(fts,simTrack,  hTDRResolution_12_24_plus);
        computePull(fts,simTrack,hPull_12_24_plus);
      }
      else{
        computeResolution(fts,simTrack,hResolution_12_24_minus); 
        computeTDRResolution(fts,simTrack,  hTDRResolution_12_24_minus);
        computePull(fts,simTrack,hPull_12_24_minus);
      }
    }
  }
}
void HTrack::computeTDRResolution ( FreeTrajectoryState fts,
SimTrack simTracks,
HResolution hReso 
)

Definition at line 271 of file HTrack.cc.

References abs, FreeTrajectoryState::charge(), HResolution::Fill(), CoreSimTrack::momentum(), FreeTrajectoryState::momentum(), PV3DBase< T, PVType, FrameType >::perp(), resolution(), FreeTrajectoryState::signedInverseMomentum(), mathSSE::sqrt(), and CoreSimTrack::type().

Referenced by computeResolutionAndPull().

                                                     {

  int simCharge = -simTrack.type()/ abs(simTrack.type());

  double invSimP =  (simTrack.momentum().mag() == 0 ) ? 0 : simTrack.momentum().mag();
  double signedInverseRecMom = (simTrack.momentum().mag() == 0 ) ? 0 : fts.signedInverseMomentum();

  hReso->Fill(simTrack.momentum().mag(),
              sqrt(simTrack.momentum().Perp2()),
              simTrack.momentum().eta(),
              simTrack.momentum().phi(),
              resolution(signedInverseRecMom , simCharge*invSimP ),
              resolution(fts.charge()/fts.momentum().perp(),simCharge/sqrt(simTrack.momentum().Perp2())));
}
void HTrack::Fill ( TrajectoryStateOnSurface tsos)

Definition at line 129 of file HTrack.cc.

References TrajectoryStateOnSurface::freeState().

Referenced by MuonTrackAnalyzer::fillPlots().

                                               { 
  Fill(*tsos.freeState());
}
void HTrack::Fill ( FreeTrajectoryState fts)
void HTrack::FillDeltaR ( double  deltaR)

Definition at line 142 of file HTrack.cc.

References HTrackVariables::FillDeltaR(), and hVariables.

Referenced by MuonTrackAnalyzer::fillPlots().

double HTrack::pull ( double  rec,
double  sim,
double  sigmarec 
)

Definition at line 152 of file LA_Results.cc.

References AlCaHLTBitMon_ParallelJobs::p, funct::pow(), and w().

Referenced by computePull().

                                                                  {
  float p(0),w(0);
  BOOST_FOREACH(EnsembleSummary ensemble, ensembles) {
    const float unc2 = pow(ensemble.pull.second,2);
    p+=  ensemble.pull.first / unc2;
    w+= 1/unc2;
  }
  return p/w;
}
double HTrack::resolution ( double  rec,
double  sim 
)

Definition at line 124 of file HTrack.cc.

Referenced by computeResolution(), and computeTDRResolution().

                                              {
  return (rec-sim)/sim;
}

Member Data Documentation

DQMStore* HTrack::dbe_ [private]

Definition at line 48 of file HTrack.h.

Referenced by HTrack().

bool HTrack::doSubHisto [private]

Definition at line 123 of file HTrack.h.

Referenced by computeResolutionAndPull(), and HTrack().

Definition at line 54 of file HTrack.h.

Referenced by computeResolutionAndPull(), and HTrack().

Definition at line 83 of file HTrack.h.

Referenced by computeResolutionAndPull(), and HTrack().

Definition at line 88 of file HTrack.h.

Referenced by computeResolutionAndPull(), and HTrack().

Definition at line 68 of file HTrack.h.

Referenced by computeResolutionAndPull(), and HTrack().

Definition at line 93 of file HTrack.h.

Referenced by computeResolutionAndPull(), and HTrack().

Definition at line 113 of file HTrack.h.

Referenced by computeResolutionAndPull(), and HTrack().

Definition at line 103 of file HTrack.h.

Referenced by computeResolutionAndPull(), and HTrack().

Definition at line 98 of file HTrack.h.

Referenced by computeResolutionAndPull(), and HTrack().

Definition at line 118 of file HTrack.h.

Referenced by computeResolutionAndPull(), and HTrack().

Definition at line 108 of file HTrack.h.

Referenced by computeResolutionAndPull(), and HTrack().

Definition at line 73 of file HTrack.h.

Referenced by computeResolutionAndPull(), and HTrack().

Definition at line 63 of file HTrack.h.

Referenced by computeResolutionAndPull(), and HTrack().

Definition at line 78 of file HTrack.h.

Referenced by computeResolutionAndPull(), and HTrack().

Definition at line 53 of file HTrack.h.

Referenced by computeResolutionAndPull(), and HTrack().

Definition at line 81 of file HTrack.h.

Referenced by computeResolutionAndPull(), and HTrack().

Definition at line 86 of file HTrack.h.

Referenced by computeResolutionAndPull(), and HTrack().

Definition at line 66 of file HTrack.h.

Referenced by computeResolutionAndPull(), and HTrack().

Definition at line 91 of file HTrack.h.

Referenced by computeResolutionAndPull(), and HTrack().

Definition at line 111 of file HTrack.h.

Referenced by computeResolutionAndPull(), and HTrack().

Definition at line 101 of file HTrack.h.

Referenced by computeResolutionAndPull(), and HTrack().

Definition at line 96 of file HTrack.h.

Referenced by computeResolutionAndPull(), and HTrack().

Definition at line 116 of file HTrack.h.

Referenced by computeResolutionAndPull(), and HTrack().

Definition at line 106 of file HTrack.h.

Referenced by computeResolutionAndPull(), and HTrack().

Definition at line 71 of file HTrack.h.

Referenced by computeResolutionAndPull(), and HTrack().

Definition at line 61 of file HTrack.h.

Referenced by computeResolutionAndPull(), and HTrack().

Definition at line 76 of file HTrack.h.

Referenced by computeResolutionAndPull(), and HTrack().

Definition at line 58 of file HTrack.h.

Referenced by HTrack().

Definition at line 57 of file HTrack.h.

Referenced by computeResolutionAndPull(), and HTrack().

Definition at line 82 of file HTrack.h.

Referenced by computeResolutionAndPull(), and HTrack().

Definition at line 87 of file HTrack.h.

Referenced by computeResolutionAndPull(), and HTrack().

Definition at line 67 of file HTrack.h.

Referenced by computeResolutionAndPull(), and HTrack().

Definition at line 92 of file HTrack.h.

Referenced by computeResolutionAndPull(), and HTrack().

Definition at line 112 of file HTrack.h.

Referenced by computeResolutionAndPull(), and HTrack().

Definition at line 102 of file HTrack.h.

Referenced by computeResolutionAndPull(), and HTrack().

Definition at line 97 of file HTrack.h.

Referenced by computeResolutionAndPull(), and HTrack().

Definition at line 117 of file HTrack.h.

Referenced by computeResolutionAndPull(), and HTrack().

Definition at line 107 of file HTrack.h.

Referenced by computeResolutionAndPull(), and HTrack().

Definition at line 72 of file HTrack.h.

Referenced by computeResolutionAndPull(), and HTrack().

Definition at line 62 of file HTrack.h.

Referenced by computeResolutionAndPull(), and HTrack().

Definition at line 77 of file HTrack.h.

Referenced by computeResolutionAndPull(), and HTrack().

Definition at line 50 of file HTrack.h.

Referenced by computeResolutionAndPull(), Fill(), FillDeltaR(), and HTrack().

TString HTrack::theName [private]

Definition at line 120 of file HTrack.h.

TString HTrack::where [private]

Definition at line 121 of file HTrack.h.