//root script //reads a file with a charge distribution. Steered by a given _Rate this //charge is normalized to one drift step, then displaced and copied. //For monitoring purposes the first 120 drift-steps are written to files //in steps of 10. //Author: Felix Boehmer //needs a lot of changes { #include #include #include #include #include //parameters int _EventsToSim = 4e6; double _Rate = 2e-2; double _IonDriftVel = 1.766e-6; int _EventsSimInInput = 10000; int drift_control = 0; //keep track of the number of drift-steps double minR; double segR; int nSegR; double minZ; double segZ; int nSegZ; //--------------------------------------------------------------------------- std::string _Input; std::cout<<"\n\nPlease enter the name of the output file of createSpaceCharge.C" <>minR>>segR>>nSegR>>minZ>>segZ>>nSegZ; //# of events needed to drift through one segment double evtsSeg = segZ/_IonDriftVel*_Rate; //read charge density double chargeDensOld[nSegR][nSegZ]; for (int nr=0; nr>chargeDensOld[nr][nz]; //normalize the charge to the amount expected for the number of //events needed for one drift-step chargeDensOld[nr][nz] = chargeDensOld[nr][nz]/_EventsSimInInput*evtsSeg; } infile.close(); double chargeDens[nSegR][nSegZ]; for (int nr=0; nr0; nz--) chargeDens[nr][nz] = chargeDens[nr][nz-1]; //the segments in front of the gems are emptied for (int nr=0; nr