// // 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 = 0; 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 = 0; fRNG = new TRandom3(); //Print(); } PndMvdCalcStrip::PndMvdCalcStrip(const PndMvdStripDigiPar* digipar, SensorSide side) { if(side == kTOP) { fPitch = digipar->GetTopPitch(); fOrient = digipar->GetOrient(); fAnchor = digipar->GetTopAnchor(); fNrStrips = digipar->GetNrTopFE()*digipar->GetNrFECh(); } else if(side == kBOTTOM) { fPitch = digipar->GetBotPitch(); fOrient = digipar->GetOrient() + digipar->GetSkew(); fAnchor = digipar->GetBotAnchor(); fNrStrips = digipar->GetNrBotFE()*digipar->GetNrFECh(); } fNrFeChannels = digipar->GetNrFECh(); fThreshold = digipar->GetThreshold(); fNoise = digipar->GetNoise(); fStripDir.Set(cos(fOrient),sin(fOrient)); fOrthoDir.Set(sin(fOrient),-cos(fOrient)); fVerboseLevel = 0; fRNG = new TRandom3(); if (fVerboseLevel > 0) 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 smearedQ; if (path.Mod()<1E-18) { std::cout<<"-W- PndMvdCalcStrip::GetStrips : No Trajectory inside Sensor! (out-in).Mod() = "< 1) std::cout<<" pathlength: "< 2) std::cout<<" nuIn = "< (Double_t(fNrStrips))){ Q *= ((Double_t)fNrStrips-nuOut)/(-nuOut+nuIn); nuIn = Double_t(fNrStrips); } // is the Out-Point inside active area ? if (nuOut<0.){ Q *= (nuIn)/(-nuOut+nuIn); nuOut = 0.; } else if (nuOut > (Double_t(fNrStrips))){ Q *= ((Double_t)fNrStrips-nuIn)/(nuOut-nuIn); nuOut = Double_t(fNrStrips); } // only one strip hit ? if (Int_t(nuIn) == Int_t(nuOut)){ // this strip collected the entire charge smearedQ = SmearCharge(Q); if (smearedQ >= fThreshold) strips.push_back(PndMvdStrip(Int_t(nuOut),smearedQ)); if (fVerboseLevel > 1) std::cout<<" -> 1 strip hit."<nuIn) ? 1. : -1.; Int_t nrHits = 0; // calculate portion of track in first strip Int_t nextIn = Int_t(nuIn + 0.5+0.5*dir); Double_t Q1 = dQ*std::fabs(nextIn-nuIn); if (fVerboseLevel > 2){ std::cout<<" part of first strip : "<= fThreshold) strips.push_back(PndMvdStrip(Int_t(nuIn),smearedQ)); nrHits++; Q -= Q1; // calculate portion of track in last strip Int_t prevOut = Int_t(nuOut + 0.5-0.5*dir); Double_t Q2 = dQ*std::fabs(nuOut-prevOut); if (fVerboseLevel > 2){ std::cout<<" part of last strip : "<<(nuOut-prevOut)<= fThreshold) strips.push_back(PndMvdStrip(Int_t(nuOut),smearedQ)); nrHits++; Q -= Q2; // Distribute the charge among the intermediate strips nextIn = Int_t(nextIn - 0.5 + 0.5*dir); prevOut = Int_t(prevOut - 0.5 + 0.5*dir); if (fVerboseLevel > 2) { std::cout<<" dir="< 1) std::cout<<" -> "<Gaus(charge,fNoise); if (fVerboseLevel > 3) std::cout<<" charge = "<