// // C++ Implementation: PndMvdCalcStrip // // Description: // // // Author: HG Zaunick , (C) 2007 // // Copyright: See COPYING file that comes with this distribution // // #include #include "PndMvdCalcStrip.h" #include "TRandom3.h" PndMvdCalcStrip::PndMvdCalcStrip(){ fPitch = 0.; fOrient = 0.; fAnchor = TVector2(0.,0.); fNrStrips = 0; fThreshold = 0.; fNoise = 0.; fVerboseLevel = 1; fRNG = new TRandom3(); } PndMvdCalcStrip::PndMvdCalcStrip(Double_t pitch, Double_t orient, Int_t nrStrips, Int_t nrFeChannels, const TVector2& firstStripAnchor, Double_t threshold, Double_t noise) : fPitch(pitch), fOrient(orient), fNrStrips(nrStrips), fNrFeChannels(nrFeChannels), fAnchor(firstStripAnchor), fThreshold(threshold), fNoise(noise) { fStripDir.Set(cos(fOrient),sin(fOrient)); fOrthoDir.Set(sin(fOrient),-cos(fOrient)); fVerboseLevel = 1; fRNG = new TRandom3(); //Print(); } std::vector PndMvdCalcStrip::GetStrips(Double_t inx, Double_t iny, Double_t inz, Double_t outx, Double_t outy, Double_t outz, Double_t eLoss) { if (fVerboseLevel > 2) std::cout<<"-I- PndMvdCalcStrip::GetStrips "< 2){ std::cout<<" InPoint: ("< strips; Double_t fSmeared; if (path.Mod()<1E-18) { std::cout<<"-W- PndMvdCalcStrip::GetStrips : No Trajectory inside Sensor!"< 1) std::cout<<" pathlength: "< 2) std::cout<<" nuIn = "< (Double_t(fNrStrips)-0.5)){ Q *= ((Double_t)fNrStrips-0.5-nuOut)/(-nuOut+nuIn); nuIn = Double_t(fNrStrips)-.5; } // is the Out-Point inside active area ? if (nuOut<-0.5){ Q *= (nuIn+0.5)/(-nuOut+nuIn); nuOut = -0.5; } else if (nuOut > (Double_t(fNrStrips)-0.5)){ Q *= ((Double_t)fNrStrips-0.5-nuIn)/(nuOut-nuIn); nuOut = Double_t(fNrStrips)-.5; } // only one strip hit ? if (Int_t(nuIn+0.5) == Int_t(nuOut+0.5)){ // this strip collected the entire charge fSmeared = SmearCharge(Q); if (fSmeared >= fThreshold) strips.push_back(PndMvdStrip(Int_t(nuOut+0.5),fSmeared)); if (fVerboseLevel > 1) std::cout<<" -> 1 strip hit."<0.){ Double_t Q1 = Q*(std::floor(nuIn+0.5)+0.5-nuIn)/(nuOut-nuIn); if (fVerboseLevel > 2){ std::cout<<" part of first strip : "<= fThreshold) strips.push_back(PndMvdStrip(Int_t(nuIn+0.5),fSmeared)); nrHits++; Q -= Q1; nuIn = std::floor(nuIn+0.5) + 0.5; } else { Double_t Q1 = Q*(nuIn-(std::floor(nuIn+0.5)-0.5))/(-nuOut+nuIn); if (fVerboseLevel > 2){ std::cout<<" part of first strip : "<= fThreshold) strips.push_back(PndMvdStrip(Int_t(nuIn+0.5),fSmeared)); nrHits++; Q -= Q1; nuIn = std::floor(nuIn+0.5) - 0.5; } // calculate portion of track in last strip if (dir<0.){ Double_t Q2 = Q*(std::floor(nuOut+0.5)+0.5-nuOut)/(nuIn-nuOut); if (fVerboseLevel > 2){ std::cout<<" part of last strip : "<= fThreshold) strips.push_back(PndMvdStrip(Int_t(nuOut+0.5),fSmeared)); nrHits++; Q -= Q2; nuOut = std::floor(nuOut+0.5) + 0.5; } else { Double_t Q2 = Q*(nuOut-(std::floor(nuOut+0.5)-0.5))/(-nuIn+nuOut); if (fVerboseLevel > 2){ std::cout<<" part of last strip : "<= fThreshold) strips.push_back(PndMvdStrip(Int_t(nuOut+0.5),fSmeared)); nrHits++; Q -= Q2; nuOut = std::floor(nuOut+0.5) - 0.5; } if (fVerboseLevel > 2) { std::cout<<" dir="<0.)?1:-1)< 1) std::cout<<" -> "<Gaus(charge,fNoise); if (fVerboseLevel > 3) std::cout<<" charge = "<