Fork me on GitHub

Changeset 042c7b3 in git


Ignore:
Timestamp:
Apr 23, 2015, 5:39:28 PM (10 years ago)
Author:
Michele Selvaggi <michele.selvaggi@…>
Branches:
ImprovedOutputFile, Timing, dual_readout, llp, master
Children:
e024347
Parents:
5d622b2
Message:

adapted Event Display detector card parser for reading efficiency formula without backslashes

File:
1 edited

Legend:

Unmodified
Added
Removed
  • display/Delphes3DGeometry.cc

    r5d622b2 r042c7b3  
    2020#include <set>
    2121#include <map>
     22#include <string>
    2223#include <utility>
    2324#include <vector>
     
    3738#include "classes/DelphesClasses.h"
    3839#include "TF2.h"
     40#include "TFormula.h"
    3941#include "TH1F.h"
    4042#include "TMath.h"
     
    9092   tk_length_ = confReader->GetDouble(Form("%s::HalfLength",ParticlePropagator), 3.0)*100.;     // tk_length
    9193   tk_Bz_     = confReader->GetDouble("ParticlePropagator::Bz", 0.0);                           // tk_Bz
    92 
     94   
     95   string buffer;
     96   const char *it;
     97 
     98   
    9399   {
    94100   TString tkEffFormula = confReader->GetString(Form("%s::EfficiencyFormula",TrackingEfficiency),"abs(eta)<3.0");
     
    96102   tkEffFormula.ReplaceAll("eta","y");
    97103   tkEffFormula.ReplaceAll("phi","0.");
    98    TF2* tkEffFunction = new TF2("tkEff",tkEffFormula,0,1000,-10,10);
     104 
     105   for(it = tkEffFormula.Data(); *it; ++it)
     106   {
     107     if(*it == ' ' || *it == '\t' || *it == '\r' || *it == '\n' || *it == '\\' ) continue;
     108     buffer.push_back(*it);
     109   }
     110
     111   TF2* tkEffFunction = new TF2("tkEff",buffer.c_str(),0,1000,-10,10);
    99112   TH1F etaHisto("eta","eta",100,5.,-5.);
    100113   Double_t pt,eta;
     
    118131   muonEffFormula.ReplaceAll("eta","y");
    119132   muonEffFormula.ReplaceAll("phi","0.");
    120    TF2* muEffFunction = new TF2("muEff",muonEffFormula,0,1000,-10,10);
     133   
     134   buffer.clear();
     135   for(it = muonEffFormula.Data(); *it; ++it)
     136   {
     137     if(*it == ' ' || *it == '\t' || *it == '\r' || *it == '\n' || *it == '\\' ) continue;
     138     buffer.push_back(*it);
     139   }
     140
     141   TF2* muEffFunction = new TF2("muEff",buffer.c_str(),0,1000,-10,10);
    121142   TH1F etaHisto("eta2","eta2",100,5.,-5.);
    122143   Double_t pt,eta;
Note: See TracChangeset for help on using the changeset viewer.