6 #include <marlin/VerbosityLevels.h>
27 gammadist( std::gamma_distribution<float>( _qbar/_theta , _theta ) )
53 TFile* file = TFile::Open( fileName.c_str() ,
"READ") ;
56 std::cerr <<
"ERROR : file " << fileName <<
" not found for AsicPolya::readFile" << std::endl ;
60 TTree* tree =
dynamic_cast<TTree*
>( file->Get(
"tree") ) ;
63 std::cerr <<
"ERROR : tree not present in file " << fileName << std::endl ;
71 std::vector<double>* position = NULL ;
73 tree->SetBranchAddress(
"LayerID" , &layerID) ;
74 tree->SetBranchAddress(
"AsicID" , &asicID) ;
75 tree->SetBranchAddress(
"qbar" , &qbarAsic) ;
76 tree->SetBranchAddress(
"delta" , &deltaAsic) ;
77 tree->SetBranchAddress(
"Position" , &position) ;
80 while ( tree->GetEntry(iEntry++) )
82 if ( qbarAsic <= 0 || deltaAsic <= 0 )
85 float alpha = qbarAsic/deltaAsic ;
86 float delta = deltaAsic ;
88 std::gamma_distribution<float> localDist( alpha , delta ) ;
90 int iAsic =
static_cast<int>( (position->at(0)-10.408)/(8*10.408) ) ;
91 int jAsic =
static_cast<int>( (position->at(1)-10.408)/(8*10.408) ) ;
92 int K =
static_cast<int>( (position->at(2)-26.131)/26.131 + 0.5 ) ;
95 if ( asicID == -1 && layerID != -1 )
98 polyaMap.insert( std::make_pair(
AsicKey(K , iAsic , jAsic) , localDist) ) ;
106 AsicKey asicKey(cellID->
K() , (cellID->
I()-1)/8 , (cellID->
J()-1)/8) ;
108 std::map<AsicKey, std::gamma_distribution<float> >::iterator it =
polyaMap.find( asicKey ) ;
void readFile(std::string fileName)
virtual float getCharge(SimDigitalGeomCellId *cellID)
std::map< AsicKey, std::gamma_distribution< float > > polyaMap
void setSeed(unsigned int value)
AsicPolya(float _qbar, float _theta, std::string fileName)