9 #include <marlin/VerbosityLevels.h>
10 #include <marlin/Exceptions.h>
13 using namespace marlin ;
16 : chargeMap() , parameters()
27 float chargeTotCheck = 0 ;
35 for (
int I = minCellI ; I <= maxCellI ; ++I )
40 for (
int J = minCellJ ; J <= maxCellJ ; ++J )
50 streamlog_out( MESSAGE ) <<
"!!!!!!!!!!Negative Charge!!!!!!!!!!" << std::endl
51 <<
" X " << posJ <<
" " << minJ <<
" " << maxJ << std::endl
52 <<
" Y " << posI <<
" " << minI <<
" " << maxI << std::endl ;
57 streamlog_out( DEBUG ) <<
" Charge = " << charge <<
" ; total splitted charge = " << chargeTotCheck << std::endl ;
73 float _normalisation = 0 ;
82 streamlog_out( DEBUG ) <<
"Charge splitter normalisation factor: " <<
normalisation << std::endl;
88 float integralResult = 0.0f ;
96 return integralResult ;
111 float _normalisation =
static_cast<float>( 2*M_PI ) ;
114 streamlog_out( DEBUG ) <<
"Charge splitter normalisation factor: " <<
normalisation << std::endl ;
125 return (term1 - term2 - term3 + term4) ;
140 TFile* file = TFile::Open( fileName.c_str() ,
"READ") ;
143 std::cerr <<
"ERROR : file " << fileName <<
" not found for MultiplicityChargeSplitterExactPerAsic::readFile" << std::endl ;
147 TTree* tree =
dynamic_cast<TTree*
>( file->Get(
"tree") ) ;
150 std::cerr <<
"ERROR : tree not present in file " << fileName << std::endl ;
157 std::vector<double>* position = NULL ;
159 tree->SetBranchAddress(
"LayerID" , &layerID) ;
160 tree->SetBranchAddress(
"AsicID" , &asicID) ;
161 tree->SetBranchAddress(
"d" , &dAsic) ;
162 tree->SetBranchAddress(
"Position" , &position) ;
165 while ( tree->GetEntry(iEntry++) )
167 int iAsic =
static_cast<int>( (position->at(0)-10.408)/(8*10.408) ) ;
168 int jAsic =
static_cast<int>( (position->at(1)-10.408)/(8*10.408) ) ;
169 int K =
static_cast<int>( (position->at(2)-26.131)/26.131 + 0.5 ) ;
171 if ( asicID == -1 && layerID != -1 )
172 dMap.insert( std::make_pair(
AsicKey(K) , dAsic) ) ;
174 dMap.insert( std::make_pair(
AsicKey(K , iAsic , jAsic) , dAsic) ) ;
181 AsicKey asicKey(cellID->
K() , (cellID->
I()-1)/8 , (cellID->
J()-1)/8) ;
183 std::map<AsicKey, float >::iterator it =
dMap.find( asicKey ) ;
185 if ( it ==
dMap.end() )
188 if ( it ==
dMap.end() )
virtual void addCharge(float charge, float posI, float posJ, SimDigitalGeomCellId *cellID)
virtual void addCharge(float charge, float posI, float posJ, SimDigitalGeomCellId *)
std::vector< float > erfWeigth
std::map< AsicKey, float > dMap
void readFile(std::string fileName)
std::map< I_J_Coordinates, float > chargeMap
virtual ~ExactSpreaderPerAsic()
virtual float computeIntegral(float x1, float x2, float y1, float y2) const =0
std::vector< float > erfWidth
virtual float computeIntegral(float x1, float x2, float y1, float y2) const
std::pair< int, int > I_J_Coordinates
ChargeSpreaderParameters parameters
ExactSpreaderPerAsic(std::string fileName)
virtual ~ChargeSpreader()
virtual ~GaussianSpreader()
float computeIntegral(float x1, float x2, float y1, float y2) const