4 #include <marlin/VerbosityLevels.h>
43 TFile* file = TFile::Open( fileName.c_str() ,
"READ") ;
46 std::cerr <<
"ERROR : file " << fileName <<
" not found for AsicEfficiency::readFile" << std::endl ;
50 TTree* tree =
dynamic_cast<TTree*
>( file->Get(
"tree") ) ;
53 std::cerr <<
"ERROR : tree not present in file " << fileName << std::endl ;
60 std::vector<double>* efficiencies = NULL ;
61 std::vector<double>* position = NULL ;
63 tree->SetBranchAddress(
"LayerID" , &layerID) ;
64 tree->SetBranchAddress(
"AsicID" , &asicID) ;
65 tree->SetBranchAddress(
"PadID" , &padID) ;
66 tree->SetBranchAddress(
"Efficiencies" , &efficiencies) ;
67 tree->SetBranchAddress(
"Position" , &position) ;
70 while ( tree->GetEntry(iEntry++) )
75 int iAsic =
static_cast<int>( (position->at(0)-10.408)/(8*10.408) ) ;
76 int jAsic =
static_cast<int>( (position->at(1)-10.408)/(8*10.408) ) ;
77 int K =
static_cast<int>( (position->at(2)-26.131)/26.131 + 0.5 ) ;
80 if ( asicID == -1 && layerID != -1 )
81 effMap.insert( std::make_pair(
AsicKey(K) , efficiencies->at(0)) ) ;
83 effMap.insert( std::make_pair(
AsicKey(K , iAsic , jAsic) , efficiencies->at(0)) ) ;
91 AsicKey asicKey(cellID->
K() , (cellID->
I()-1)/8 , (cellID->
J()-1)/8) ;
93 std::map<AsicKey,float>::const_iterator it =
effMap.find( asicKey ) ;
void readFile(std::string fileName)
virtual ~EfficiencyManager()
AsicEfficiency(std::string fileName, float globalVal=1.0)
virtual float getEfficiency(SimDigitalGeomCellId *cellID)
virtual ~AsicEfficiency()
std::map< AsicKey, float > effMap