- Int_t nhits = hits->GetEntriesFast();
-
- // Int_t arg[6] = {0,0,0,0,0,0};
- Int_t nofAnodes = fNofMaps/2;
- Double_t sddLength = seg->Dx();
- Double_t sddWidth = seg->Dz();
- Double_t anodePitch = seg->Dpz(0);
- Double_t timeStep = seg->Dpx(0);
- Double_t driftSpeed ; // drift velocity (anode dependent)
- Double_t norm = simpar->GetSDDMaxAdc()/simpar->GetSDDDynamicRange(); // maxadc/topValue;
- Double_t cHloss = simpar->GetSDDChargeLoss();
- Float_t dfCoeff, s1;
- simpar->GetSDDDiffCoeff(dfCoeff,s1); // Signal 2d Shape
- Double_t eVpairs = simpar->GetGeVToCharge()*1.0E9; // 3.6 eV by def.
- Double_t nsigma = simpar->GetNSigmaIntegration(); //
- Int_t nlookups = simpar->GetGausNLookUp(); //
- Float_t jitter = simpar->GetSDDJitterError(); //
+ Int_t nhits = hits->GetEntriesFast();
+
+ // Int_t arg[6] = {0,0,0,0,0,0};
+ Int_t nofAnodes = fNofMaps/2;
+ Double_t sddLength = seg->Dx();
+ Double_t anodePitch = seg->Dpz(0);
+ Double_t timeStep = seg->Dpx(0);
+ Double_t driftSpeed ; // drift velocity (anode dependent)
+ Double_t nanoampToADC = simpar->GetSDDMaxAdc()/simpar->GetSDDDynamicRange(); // maxadc/topValue;
+ Double_t cHloss = simpar->GetSDDChargeLoss();
+ Float_t dfCoeff, s1;
+ simpar->GetSDDDiffCoeff(dfCoeff,s1); // Signal 2d Shape
+ Double_t eVpairs = simpar->GetGeVToCharge()*1.0E9; // 3.6 eV by def.
+ Double_t nsigma = simpar->GetNSigmaIntegration(); //
+ Int_t nlookups = simpar->GetGausNLookUp(); //
+ Float_t jitter = simpar->GetSDDJitterError(); //
+ Float_t trigDelay = simpar->GetSDDTrigDelay();
+
+ // Piergiorgio's part (apart for few variables which I made float
+ // when i thought that can be done
+ // Fill detector maps with GEANT hits
+ // loop over hits in the module
+
+ const Float_t kconv = 1.0e+6; // GeV->KeV
+ Int_t itrack = 0;
+ Int_t iWing; // which detector wing/side.
+ Int_t ii,kk,ka,kt; // loop indexs
+ Int_t ia,it,index; // sub-pixel integration indexies
+ Int_t iAnode; // anode number.
+ Int_t timeSample; // time buckett.
+ Int_t anodeWindow; // anode direction charge integration width
+ Int_t timeWindow; // time direction charge integration width
+ Int_t jamin,jamax; // anode charge integration window
+ Int_t jtmin,jtmax; // time charge integration window
+ Int_t nsplitAn; // the number of splits in anode and time windows
+ Int_t nsplitTb; // the number of splits in anode and time windows
+ Int_t nOfSplits; // number of times track length is split into
+ Float_t nOfSplitsF; // Floating point version of nOfSplits.
+ Float_t kkF; // Floating point version of loop index kk.
+ Double_t pathInSDD; // Track length in SDD.
+ Double_t drPath; // average position of track in detector. in microns
+ Double_t drTime; // Drift time
+ Double_t avDrft; // x position of path length segment in cm.
+ Double_t avAnode; // Anode for path length segment in Anode number (float)
+ Double_t zAnode; // Floating point anode number.
+ Double_t driftPath; // avDrft in microns.
+ Double_t width; // width of signal at anodes.
+ Double_t depEnergy; // Energy deposited in this GEANT step.
+ Double_t xL[3],dxL[3]; // local hit coordinates and diff.
+ Double_t sigA; // sigma of signal at anode.
+ Double_t sigT; // sigma in time/drift direction for track segment
+ Double_t aStep,aConst; // sub-pixel size and offset anode
+ Double_t tStep,tConst; // sub-pixel size and offset time
+ Double_t amplitude; // signal amplitude for track segment in nanoAmpere
+ Double_t chargeloss; // charge loss for track segment.
+ Double_t anodeAmplitude; // signal amplitude in anode direction
+ Double_t aExpo; // exponent of Gaussian anode direction
+ Double_t timeAmplitude; // signal amplitude in time direction
+ Double_t tExpo; // exponent of Gaussian time direction
+ Double_t tof; // Time of flight in ns of this step.
+
+ for(ii=0; ii<nhits; ii++) {
+ if(!mod->LineSegmentL(ii,xL[0],dxL[0],xL[1],dxL[1],xL[2],dxL[2],
+ depEnergy,itrack)) continue;
+ Float_t xloc=xL[0];
+ if(xloc>0) iWing=0; // left side, carlos channel 0
+ else iWing=1; // right side