diff --git a/core/detectors/mvd/CbmMvdStationPar.cxx b/core/detectors/mvd/CbmMvdStationPar.cxx index 409b95b78d5ff039fab8ad634b3bc30527878b96..3be56060a61a7bf7afc3532314405690f841a9f3 100644 --- a/core/detectors/mvd/CbmMvdStationPar.cxx +++ b/core/detectors/mvd/CbmMvdStationPar.cxx @@ -93,7 +93,7 @@ void CbmMvdStationPar::SetParameterMax(std::vector<Double_t>& parArray, Int_t iS if ((iStation < 0) || (iStation >= fStationCount)) { LOG(error) << "Station number out of Range "; } else { Double_t& v = parArray[iStation]; - if (isnan(v) || (v < value)) { v = value; } + if (std::isnan(v) || (v < value)) { v = value; } } } // ------------------------------------------------------------------------- @@ -106,7 +106,7 @@ void CbmMvdStationPar::SetParameterMin(std::vector<Double_t>& parArray, Int_t iS if ((iStation < 0) || (iStation >= fStationCount)) { LOG(error) << "Station number out of Range "; } else { Double_t& v = parArray[iStation]; - if (isnan(v) || (v > value)) { v = value; } + if (std::isnan(v) || (v > value)) { v = value; } } } // ------------------------------------------------------------------------- diff --git a/core/detectors/mvd/SensorDataSheets/CbmMvdMimosis.cxx b/core/detectors/mvd/SensorDataSheets/CbmMvdMimosis.cxx index 86617fc7423c8d8dc094c67791f4f88961d39a1c..c7d1acaf32f4557bbe5eafa0b9b2e5176ef3ab8a 100644 --- a/core/detectors/mvd/SensorDataSheets/CbmMvdMimosis.cxx +++ b/core/detectors/mvd/SensorDataSheets/CbmMvdMimosis.cxx @@ -32,6 +32,7 @@ CbmMvdMimosis::CbmMvdMimosis() fEpiTh = 18e-4; // Thickness of the epitaxial layer fChargeThreshold = 1.; + fAnalogThreshold =150; //Threshold in electrons /** Description of the sensor for the digitizer //mesaured by melisa for Mimosa26AHR**/ fNoise = 13; diff --git a/core/detectors/mvd/SensorDataSheets/CbmMvdSensorDataSheet.cxx b/core/detectors/mvd/SensorDataSheets/CbmMvdSensorDataSheet.cxx index 6d424bd9e5e6356d572a4317e0a8e949fa46d082..135afcdc3ce2dcf8760cd7290b56f8efeb385400 100644 --- a/core/detectors/mvd/SensorDataSheets/CbmMvdSensorDataSheet.cxx +++ b/core/detectors/mvd/SensorDataSheets/CbmMvdSensorDataSheet.cxx @@ -50,6 +50,11 @@ CbmMvdSensorDataSheet::CbmMvdSensorDataSheet() , fPixelsPerBank(0) , fAdcStepSize(fAdcDynamic / fAdcSteps) , fValidData(kFALSE) + , fSignalRiseTime(nan("NotSet")) + , fSignalFallTime(nan("NotSet")) + , fAnalogThreshold(-1) + + { } diff --git a/core/detectors/mvd/SensorDataSheets/CbmMvdSensorDataSheet.h b/core/detectors/mvd/SensorDataSheets/CbmMvdSensorDataSheet.h index 0d64bab7bf05410595a8b52118352f337fc0b6b6..787fe4c19a3091252f76e7458710fe93dcdb092e 100644 --- a/core/detectors/mvd/SensorDataSheets/CbmMvdSensorDataSheet.h +++ b/core/detectors/mvd/SensorDataSheets/CbmMvdSensorDataSheet.h @@ -58,6 +58,10 @@ protected: Double_t fEpiTh; // Thickness of the epitaxial layer Double_t fChargeThreshold; + Double_t fSignalRiseTime; + Double_t fSignalFallTime; + + /** Description of the sensor for the digitizer **/ Double_t fNoise; // Noise of the sensor @@ -68,17 +72,24 @@ protected: Double_t fLorentzPar1; // Lorentz for digitizer Double_t fLorentzPar2; // Lorentz for digitizer - /** ADC description **/ + /** ADC description, relevant for sensors with analog readout (not present in the CbmMvd) **/ Int_t fAdcDynamic; Int_t fAdcOffset; Int_t fAdcBits; Int_t fAdcSteps; + Float_t fAdcStepSize; + + /** Sensor substructure, relevant for MIMOSA-26 (Prototype of the CbmMvd) **/ Int_t fStatesPerBank; Int_t fStatesPerLine; Int_t fStatesPerFrame; Int_t fPixelsPerBank; - Float_t fAdcStepSize; + + /** Threshold of the in-pixel discriminator. Relevant for MIMOSIS **/ + Int_t fAnalogThreshold; + + /** Self-organizsation **/ @@ -89,15 +100,19 @@ public: virtual TString* GetSensorName() { return &fMimosaName; }; virtual Double_t GetPixelPitchX() { return fPixelPitchX; }; virtual Double_t GetPixelPitchY() { return fPixelPitchY; }; - virtual Int_t GetNPixelsX() { return fNPixelsX; }; - virtual Int_t GetNPixelsY() { return fNPixelsY; }; - virtual Int_t GetNPixels() { return fNPixels; }; - virtual Int_t GetPixelSignX() { return fPixelSignX; }; - virtual Int_t GetPixelSignY() { return fPixelSignY; }; - virtual Int_t GetShutterSign() { return fShutterSign; }; + virtual Int_t GetNPixelsX() { return fNPixelsX; }; + virtual Int_t GetNPixelsY() { return fNPixelsY; }; + virtual Int_t GetNPixels() { return fNPixels; }; + virtual Int_t GetPixelSignX() { return fPixelSignX; }; + virtual Int_t GetPixelSignY() { return fPixelSignY; }; + virtual Int_t GetShutterSign() { return fShutterSign; }; virtual Double_t GetIntegrationTime() { return fIntegrationTime; }; virtual Double_t GetEpiThickness() { return fEpiTh; } virtual Double_t GetNoise() { return fNoise; }; + virtual Double_t GetSignalRiseTime (){ return fSignalRiseTime;}; + virtual Double_t GetSignalFallTime (){ return fSignalFallTime;}; + + /** Description of the sensor for the digitizer **/ virtual Double_t GetLandauMPV() { return fLandauMPV; }; // Landau for digitizer @@ -109,6 +124,9 @@ public: virtual Double_t GetChargeThreshold() { return fChargeThreshold; }; + virtual Int_t GetAnalogThreshold () {return fAnalogThreshold;}; + + /** ADC description **/ diff --git a/sim/detectors/mvd/plugins/tasks/CbmMvdSensorDigitizerTask.cxx b/sim/detectors/mvd/plugins/tasks/CbmMvdSensorDigitizerTask.cxx index e9d03cb7c2fa4493700afc89c343ccd53e2fce69..9d597b6aa8fd37a662d6c8dca6b6aba6ec1705c8 100644 --- a/sim/detectors/mvd/plugins/tasks/CbmMvdSensorDigitizerTask.cxx +++ b/sim/detectors/mvd/plugins/tasks/CbmMvdSensorDigitizerTask.cxx @@ -443,12 +443,8 @@ void CbmMvdSensorDigitizerTask::Exec() ProducePixelCharge(point); } //loop on MCpoints - - Int_t inputNr = 0; - Int_t eventNr = 0; - Double_t eventTime = .0; Int_t nDigis = 0; - GetEventInfo(inputNr, eventNr, eventTime); + GetEventInfo(fInputNr, fEventNr, fEventTime); if (fproduceNoise) ProduceNoise(); @@ -459,18 +455,18 @@ void CbmMvdSensorDigitizerTask::Exec() nDigis = fDigis->GetEntriesFast(); new ((*fDigis)[nDigis]) CbmMvdDigi(fSensor->GetSensorNr(), pixel->GetX(), pixel->GetY(), pixel->GetCharge(), - fPixelSizeX, fPixelSizeY, pixel->GetTime(), pixel->GetFrame()); + fPixelSizeX, fPixelSizeY, fEventTime+ pixel->GetTime(), pixel->GetFrame()); new ((*fOutputBuffer)[nDigis]) CbmMvdDigi(fSensor->GetSensorNr(), pixel->GetX(), pixel->GetY(), pixel->GetCharge(), fPixelSizeX, fPixelSizeY, - pixel->GetTime(), pixel->GetFrame()); + fEventTime+pixel->GetTime(), pixel->GetFrame()); new ((*fDigiMatch)[nDigis]) CbmMatch(); CbmMatch* match = (CbmMatch*) fDigiMatch->At(nDigis); for (Int_t iLink = 0; iLink < pixel->GetNContributors(); iLink++) { if (pixel->GetTrackID()[iLink] > -1) - match->AddLink((Double_t) pixel->GetPointWeight()[iLink], pixel->GetPointID()[iLink], eventNr, inputNr); + match->AddLink((Double_t) pixel->GetPointWeight()[iLink], pixel->GetPointID()[iLink], fEventNr, fInputNr); else match->AddLink((Double_t) pixel->GetPointWeight()[iLink], pixel->GetPointID()[iLink]); } @@ -495,6 +491,50 @@ void CbmMvdSensorDigitizerTask::Exec() // ------------------------------------------------------------------------- + + +Int_t CbmMvdSensorDigitizerTask::GetPixelCharge(CbmMvdPixelCharge* myPixel, Double_t readoutTime) { + +/** + * Get the analog signal created by each signal. Assumption: Signal rise and signal fall follows exponential. Contributions of the individual hits add up. + **/ + + Int_t pixelCharge=0; + Double_t pixelSignalRiseTime=fsensorDataSheet->GetSignalRiseTime(); + Double_t pixelSignalFallTime=fsensorDataSheet->GetSignalFallTime(); + Int_t nHits=0; //=myPixel->GetNHits(); + + for(Int_t hitNr=0; hitNr<nHits; hitNr++){ + Int_t hitCharge=0; //=pixel->GetHitCharge(hitNr); + Int_t hitTime=0; //=pixel->GetHitTime(hitNr); + + pixelCharge=pixelCharge + hitCharge * (1- TMath::Exp(-(readoutTime-hitTime)/pixelSignalRiseTime)); //exponential signal rise of the analog charge + pixelCharge=pixelCharge - hitCharge * (1- TMath::Exp(-(readoutTime-hitTime)/pixelSignalFallTime)); //exponential signal fall of the analog charge + } + + return pixelCharge; + +} + +// ------------------------------------------------------------------------------ + + +Bool_t CbmMvdSensorDigitizerTask::GetSignalAboveThreshold (CbmMvdPixelCharge* myPixel, Double_t readoutTime) { + /** + * Checks if pixel is above threshold. + **/ + + CbmMvdSensor* mySensor; + + + + return (GetPixelCharge(myPixel, readoutTime)>fsensorDataSheet->GetAnalogThreshold ()); + +} + +// ------------------------------------------------------------------------------ + + // ------------------------------------------------------------------------- void CbmMvdSensorDigitizerTask::GetEventInfo(Int_t& inputNr, Int_t& eventNr, Double_t& eventTime) { @@ -848,6 +888,8 @@ void CbmMvdSensorDigitizerTask::ProducePixelCharge(CbmMvdPoint* point) + 0.25 * fPar1 * fPar1) + fPar2); + + if (totCharge < 1) { // cout << endl << "charge is " << totCharge << " < 1 electron thus charge is negligible" << endl; diff --git a/sim/detectors/mvd/plugins/tasks/CbmMvdSensorDigitizerTask.h b/sim/detectors/mvd/plugins/tasks/CbmMvdSensorDigitizerTask.h index a689bc9f12b6b641ff77cb56481a1b6aa01da6d5..074a4bd00d58434ceea64cfdf2751b200b19c8b7 100644 --- a/sim/detectors/mvd/plugins/tasks/CbmMvdSensorDigitizerTask.h +++ b/sim/detectors/mvd/plugins/tasks/CbmMvdSensorDigitizerTask.h @@ -75,6 +75,8 @@ public: void ProduceIonisationPoints(CbmMvdPoint* point); void ProducePixelCharge(CbmMvdPoint* point); void ProduceNoise(); + Bool_t GetSignalAboveThreshold (CbmMvdPixelCharge* myPixel, Double_t readoutTime); + Int_t GetPixelCharge(CbmMvdPixelCharge* myPixel, Double_t readoutTime); void SetProduceNoise() { fproduceNoise = kTRUE; }; @@ -93,8 +95,13 @@ public: public: // ---------- Protected data members ------------------------------------ - Int_t fcurrentFrameNumber; + // Information about event and sensor status + Int_t fcurrentFrameNumber; + Int_t fEventNr; + Int_t fInputNr; + Double_t fEventTime; + // Information about sensor Double_t fEpiTh; Double_t fSegmentLength;