diff --git a/core/detectors/mvd/CbmMvdDetector.cxx b/core/detectors/mvd/CbmMvdDetector.cxx index 8d37ee8e4086184a3d2ba5ed44e172c8ac6014b7..a247600eeaa0bbf89b6ff32c60ca65706d10c84c 100644 --- a/core/detectors/mvd/CbmMvdDetector.cxx +++ b/core/detectors/mvd/CbmMvdDetector.cxx @@ -24,6 +24,7 @@ #include <TObjArray.h> // for TObjArray #include <TRandom.h> // for TRandom, gRandom #include <TString.h> // for TString, operator==, operator<< +#include <TH1.h> // for Histograms (only base class is used) //_____________________________________________________________________________ CbmMvdDetector* CbmMvdDetector::fInstance = 0; @@ -356,6 +357,45 @@ void CbmMvdDetector::GetMatchArray(Int_t nPlugin, TClonesArray* matchArray) } } +//----------------------------------------------------------------------- + +UInt_t CbmMvdDetector::GetMaxHistoNumber(UInt_t nPlugin){ + + if (!fSensorArray) return -1; + + CbmMvdSensor* sensor= (CbmMvdSensor*)fSensorArray->At(0); + + if (sensor->GetPluginArraySize() < nPlugin) return -1; + + //CbmMvdSensorPlugin* plugin= (CbmMvdSensorPlugin*)sensor->GetPluginArray()->At(nPlugin); + + return sensor-> GetNumberOfHistograms(nPlugin); + + +}; + + +//----------------------------------------------------------------------- +TH1* CbmMvdDetector::GetHistogram(UInt_t nPlugin, UInt_t nHistogram){ + if (!fSensorArray) return 0; + + CbmMvdSensor* sensor= (CbmMvdSensor*)fSensorArray->At(0); + + if (sensor->GetPluginArraySize() < nPlugin) return 0; + if (nHistogram>=sensor->GetNumberOfHistograms(nPlugin)) return 0; + + TH1* mySummedHistogram = (TH1*)((sensor->GetHistogram(nPlugin, nHistogram))->Clone()); + + for (Int_t i=1; i<fSensorArray->GetEntriesFast(); i++) { // Read histograms from all sensors and add them up. + sensor=(CbmMvdSensor*)fSensorArray->At(i); + mySummedHistogram->Add((TH1*)sensor->GetHistogram(nPlugin, nHistogram)); + } + + return mySummedHistogram;} + +//----------------------------------------------------------------------- +TH1* CbmMvdDetector::GetHistogram(UInt_t nLevel, UInt_t nHistogramNumber, UInt_t sensorInSensorArrayNumber) {return 0;} + //----------------------------------------------------------------------- void CbmMvdDetector::Finish() { diff --git a/core/detectors/mvd/CbmMvdDetector.h b/core/detectors/mvd/CbmMvdDetector.h index 8e4ec00675a0a254411634757d25ef8cc55cdc35..ca5052b6d39d12e8a1ce6d2c4cd3fb8d1888c5df 100644 --- a/core/detectors/mvd/CbmMvdDetector.h +++ b/core/detectors/mvd/CbmMvdDetector.h @@ -27,6 +27,7 @@ #include <TClonesArray.h> // for TClonesArray #include <TNamed.h> // for TNamed #include <TString.h> // for TString +#include <TObject.h> #include <map> // for map @@ -37,6 +38,7 @@ class TBuffer; class TClass; class TMemberInspector; class TObject; +class TH1; enum class CbmMvdSensorTyp; @@ -83,8 +85,12 @@ public: fepsilon[i] = misalignment[i]; }; - void BuildDebugHistograms() { ; }; + //void BuildDebugHistograms() { ; }; void ShowDebugHistos(); + TH1* GetHistogram(UInt_t nPlugin, UInt_t nHistogramNumber); + TH1* GetHistogram(UInt_t nPlugin, UInt_t nHistogramNumber, UInt_t sensorInSensorArrayNumber); + UInt_t GetMaxHistoNumber(UInt_t nPlugin); + /** Data Processing */ void ExecChain(); //Processes the full execution chain diff --git a/core/detectors/mvd/CbmMvdSensor.cxx b/core/detectors/mvd/CbmMvdSensor.cxx index a851f9694154d982f5fac3f4aaf155ee790a7524..37dcf6b1215d6ae934909d1863883305bf36e87d 100644 --- a/core/detectors/mvd/CbmMvdSensor.cxx +++ b/core/detectors/mvd/CbmMvdSensor.cxx @@ -385,6 +385,19 @@ TClonesArray* CbmMvdSensor::GetOutputBuffer() const } // ------------------------------------------------------------------------- +TH1* CbmMvdSensor::GetHistogram(UInt_t nPlugin, UInt_t nHisto){ + if(!fPluginArray) return 0; + if(nPlugin>=(UInt_t)fPluginArray->GetEntriesFast()) return 0; + CbmMvdSensorPlugin* myPlugin= (CbmMvdSensorPlugin*)fPluginArray->At(nPlugin); + return myPlugin->GetHistogram(nHisto); +} + +UInt_t CbmMvdSensor::GetNumberOfHistograms(UInt_t nPlugin){ + if(!fPluginArray) return -1; + if(nPlugin>=(UInt_t)fPluginArray->GetEntriesFast()) return -1; + return ((CbmMvdSensorPlugin*)fPluginArray->At(nPlugin))->GetMaxHistoNumber(); +} + // ----- Coordinate Transformations -------------------------------- @@ -528,6 +541,9 @@ Double_t CbmMvdSensor::GetReadoutTime(Double_t absoluteTime) const // ------------------------------------------------------------------------- + + + void CbmMvdSensor::Print(Option_t* /*opt*/) const { LOG(info) << ToString(); } // ----- Public method Print ------------------------------------------- diff --git a/core/detectors/mvd/CbmMvdSensor.h b/core/detectors/mvd/CbmMvdSensor.h index 2b5d137469365eb1cb319aeea39eae9937f454f7..5d0aef889b4611be09e3922d0fe6247e0bbfe0e2 100644 --- a/core/detectors/mvd/CbmMvdSensor.h +++ b/core/detectors/mvd/CbmMvdSensor.h @@ -39,6 +39,7 @@ class TClonesArray; class TGeoHMatrix; class TMemberInspector; class TObject; +class TH1; class CbmMvdSensor : public TNamed, CbmMvdDetectorId { @@ -101,6 +102,7 @@ public: Int_t GetHitPlugin() const { return fHitPlugin; }; Int_t GetClusterPlugin() const { return fClusterPlugin; } TObjArray* GetPluginArray() { return fPluginArray; } + UInt_t GetPluginArraySize() {if (fPluginArray) {return fPluginArray->GetEntriesFast();} else return 0;} Double_t ComputeIndecatedAnalogTime(Double_t hitMCTime, Float_t diodeCharge); Double_t ComputeEndOfBusyTime(Double_t hitMCTime, Float_t diodeCharge, Int_t pixelNumberY); @@ -154,6 +156,8 @@ public: TClonesArray* GetOutputArray(Int_t nPlugin) const; TClonesArray* GetMatchArray(Int_t nPlugin) const; Int_t GetOutputArrayLen(Int_t nPlugin) const; + TH1* GetHistogram(UInt_t nPlugin, UInt_t nHisto); + UInt_t GetNumberOfHistograms(UInt_t nPlugin); protected: Int_t fStationNr; // Station identifier diff --git a/core/detectors/mvd/plugins/CbmMvdSensorPlugin.cxx b/core/detectors/mvd/plugins/CbmMvdSensorPlugin.cxx index 634b7bcfeb90a4a41513059478b02a263eaf34f5..44359a21fe78d570a3967df8f9a631b63e98e9e2 100644 --- a/core/detectors/mvd/plugins/CbmMvdSensorPlugin.cxx +++ b/core/detectors/mvd/plugins/CbmMvdSensorPlugin.cxx @@ -7,6 +7,7 @@ // ----- Created 02.02.2012 by M. Deveaux ----- // ------------------------------------------------------------------------- #include "CbmMvdSensorPlugin.h" +#include "TH1.h" // ----- Default constructor ------------------------------------------- CbmMvdSensorPlugin::CbmMvdSensorPlugin() @@ -35,9 +36,17 @@ CbmMvdSensorPlugin::CbmMvdSensorPlugin(const char* name) } // ------------------------------------------------------------------------- +TH1* CbmMvdSensorPlugin::GetHistogram (UInt_t number){ + if (fHistoArray){ + if (number<(UInt_t)fHistoArray->GetEntriesFast()) {return (TH1*)fHistoArray->At(number);} + } + return 0; +} + // ----- Destructor ---------------------------------------------------- CbmMvdSensorPlugin::~CbmMvdSensorPlugin() {} // ------------------------------------------------------------------------- + ClassImp(CbmMvdSensorPlugin) diff --git a/core/detectors/mvd/plugins/CbmMvdSensorPlugin.h b/core/detectors/mvd/plugins/CbmMvdSensorPlugin.h index ffe2b2adca8371eebe24b52da89b57f5c2096aaa..c1fb72aaf1075d62684f57dd4a43a74b0a2b8a87 100644 --- a/core/detectors/mvd/plugins/CbmMvdSensorPlugin.h +++ b/core/detectors/mvd/plugins/CbmMvdSensorPlugin.h @@ -22,11 +22,13 @@ #include <Rtypes.h> // for ClassDef #include <RtypesCore.h> // for Bool_t, Int_t, kTRUE #include <TObject.h> // for TObject +#include <TObjArray.h> // for TObjArray class TBuffer; class TClass; class TClonesArray; // lines 24-24 class TMemberInspector; +class TH1; enum MvdSensorPluginType { @@ -55,6 +57,8 @@ public: virtual TClonesArray* GetOutputArray() { return 0; } virtual TClonesArray* GetMatchArray() { return 0; } virtual TClonesArray* GetWriteArray() { return 0; } + virtual TH1* GetHistogram (UInt_t number); + virtual UInt_t GetMaxHistoNumber() {if (fHistoArray) {return fHistoArray->GetEntriesFast();} else return -1;} virtual void SetInputArray(TClonesArray*) { ; } virtual void SetInput(TObject*) { LOG(error) << "You are sending input to the base class instead to your plugin!"; } @@ -81,7 +85,8 @@ protected: Bool_t initialized; Bool_t fShowDebugHistos; const char* fName; - Int_t fPluginIDNumber; //Identifier for the Plugin for debugging purposes. Hardcode in implementation please. + Int_t fPluginIDNumber; // Identifier for the Plugin for debugging purposes. Hardcode in implementation please. + TObjArray* fHistoArray; // Array to hold and manage histograms for debugging. private: CbmMvdSensorPlugin& operator=(const CbmMvdSensorPlugin&); diff --git a/macro/mvd/qa/mvd_qa3_digitize.C b/macro/mvd/qa/mvd_qa3_digitize.C index 16d2a1c64f376abbbff6057f0960a5228ced3989..7fadc0ffa82259a12a86821cdaec9644390d72ba 100644 --- a/macro/mvd/qa/mvd_qa3_digitize.C +++ b/macro/mvd/qa/mvd_qa3_digitize.C @@ -75,6 +75,7 @@ void mvd_qa3_digitize(const char* setup = "sis100_electron") // ------- MVD Digitiser ---------------------------------------------- CbmMvdDigitizer* digi = new CbmMvdDigitizer("MVDDigitiser", 0, iVerbose); std::cout << "Adding Task: CbmMvdDigitiser... " << std::endl; + digi->ShowDebugHistograms(); //--- Pile Up ------- /* @@ -126,4 +127,12 @@ void mvd_qa3_digitize(const char* setup = "sis100_electron") std::cout << " Test passed" << std::endl; std::cout << " All ok " << std::endl; + //digi->Finish(); + + /*digi->CollectHistograms(); + TObjArray* digiHisto=digi->GetHistograms(); + std::cout << "Received HistoArray with Address " << digiHisto << std::endl; + std::cout << "The number of entries is " << digiHisto->GetEntriesFast() << std::endl; + ((TH1*)digiHisto->At(0))->Draw();*/ + } diff --git a/reco/detectors/mvd/plugins/tasks/CbmMvdSensorClusterfinderTask.cxx b/reco/detectors/mvd/plugins/tasks/CbmMvdSensorClusterfinderTask.cxx index e201a1d1fa3e6e2dfdadb440b1329d2843b92e28..cd951aab9c051ac1de50af11f71041404e88b5d9 100644 --- a/reco/detectors/mvd/plugins/tasks/CbmMvdSensorClusterfinderTask.cxx +++ b/reco/detectors/mvd/plugins/tasks/CbmMvdSensorClusterfinderTask.cxx @@ -111,6 +111,9 @@ void CbmMvdSensorClusterfinderTask::InitTask(CbmMvdSensor* mysensor) initialized = kTRUE; if (fShowDebugHistos) { + + fHistoArray=new TObjArray(); + fResolutionHistoX = new TH1F("SinglePointResolution_X", "SinglePointResolution_X", 10000, -0.0100, 0.0100); fResolutionHistoY = new TH1F("SinglePointResolution_Y", "SinglePointResolution_Y", 10000, -0.0100, 0.0100); fResolutionHistoCleanX = @@ -123,6 +126,19 @@ void CbmMvdSensorClusterfinderTask::InitTask(CbmMvdSensor* mysensor) new TH1F("SinglePointResolution_Y_Merged", "SinglePointResolution_Y_Merged", 10000, -0.0100, 0.0100); fBadHitHisto = new TH2F("BadHits", "Hits above 0.003cm", 1000, -2.5, 2.5, 1000, -2.5, 2.5); fFullClusterHisto = new TH1F("ChargeOfAllPixels", "ChargeOfAllPixels", 12000, 0, 12000); + + fHistoArray->AddLast(fResolutionHistoX); + fHistoArray->AddLast(fResolutionHistoY); + fHistoArray->AddLast(fResolutionHistoCleanX); + fHistoArray->AddLast(fResolutionHistoCleanY); + fHistoArray->AddLast(fResolutionHistoMergedX); + fHistoArray->AddLast(fResolutionHistoMergedY); + fHistoArray->AddLast(fBadHitHisto); + fHistoArray->AddLast(fFullClusterHisto); + + + + //} @@ -143,9 +159,11 @@ void CbmMvdSensorClusterfinderTask::InitTask(CbmMvdSensor* mysensor) char* histoTotalChargeName = new char[buf_size]; TH1F* histoTotalCharge; for (Int_t i = 0; i < 49; i++) { + snprintf(histoTotalChargeName, buf_size - 1, "totalChargeInNPixels%i", i + 1); histoTotalCharge = new TH1F(histoTotalChargeName, histoTotalChargeName, 12000, 0, 12000); fTotalChargeInNpixelsArray->AddLast(histoTotalCharge); + }; delete[] histoTotalChargeName; @@ -172,6 +190,10 @@ void CbmMvdSensorClusterfinderTask::InitTask(CbmMvdSensor* mysensor) fPixelChargeHistos->AddLast(histo); } //LOG(debug) << "-Finished- " << GetName() << ": Initialisation of sensor " << fSensor->GetName(); + + //Copy histograms in fPixelChargeHistos to fHistoArray (the array for external communications) + for (Int_t i=0;i<fPixelChargeHistos->GetEntriesFast(); i++) {fHistoArray->AddLast(fPixelChargeHistos->At(i));} + } // ------------------------------------------------------------------------- @@ -533,7 +555,7 @@ void CbmMvdSensorClusterfinderTask::UpdateDebugHistos(CbmMvdCluster* cluster) void CbmMvdSensorClusterfinderTask::Finish() { - if (fShowDebugHistos) { + if (kFALSE&&fShowDebugHistos) { //Reaction to ShowHistograms at the finish of the initial FairTask. Obsolete, thus switched off for now LOG(info) << "============================================================"; LOG(info) << GetName() << "::Finish: Total events skipped: " << fCounter; LOG(info) << "============================================================"; diff --git a/sim/detectors/mvd/CbmMvdDigitizer.cxx b/sim/detectors/mvd/CbmMvdDigitizer.cxx index 690caca94899988c3b8b4626eb4159709cdf3f7e..cdbecde152a1eca4bfcf8d298871a5327ad1ed3e 100644 --- a/sim/detectors/mvd/CbmMvdDigitizer.cxx +++ b/sim/detectors/mvd/CbmMvdDigitizer.cxx @@ -19,10 +19,15 @@ #include <Logger.h> // for Logger, LOG #include <TClonesArray.h> // for TClonesArray +#include <TObjArray.h> // fir TObjArray #include <TObject.h> // for TObject #include <TRandom.h> // for TRandom #include <TRandom3.h> // for gRandom #include <TStopwatch.h> // for TStopwatch +#include <TString.h> // for TString +#include <TCanvas.h> // for TCanvas +#include <TH1.h> // for TH1, base class used for general histograms +#include <TFile.h> // for TFile #include <cassert> // for assert #include <iomanip> // for setprecision, setw, __iom_t5 @@ -58,12 +63,15 @@ CbmMvdDigitizer::CbmMvdDigitizer() , fInputBranchName("") , fBgFileName("") , fDeltaFileName("") + , fHistoFileName("./CbmMvdDigitizer_defaultHistoFile.root") , fTimer() , fPileupManager(nullptr) , fDeltaManager(nullptr) + { fTmpDigi = new TClonesArray("CbmMvdDigi", 1000); fTmpMatch = new TClonesArray("CbmMatch", 1000); + fHistoArray=0; } // ------------------------------------------------------------------------- @@ -91,6 +99,7 @@ CbmMvdDigitizer::CbmMvdDigitizer(const char* name, Int_t iMode, Int_t /*iVerbose , fInputBranchName("MvdPoint") , fBgFileName("") , fDeltaFileName("") + , fHistoFileName("./CbmMvdDigitizer_defaultHistoFile.root") , fTimer() , fPileupManager(nullptr) , fDeltaManager(nullptr) @@ -98,6 +107,7 @@ CbmMvdDigitizer::CbmMvdDigitizer(const char* name, Int_t iMode, Int_t /*iVerbose fTmpDigi = new TClonesArray("CbmMvdDigi", 1000); fTmpMatch = new TClonesArray("CbmMatch", 1000); + fHistoArray=0; } // ------------------------------------------------------------------------- @@ -347,13 +357,110 @@ InitStatus CbmMvdDigitizer::ReInit() { return kSUCCESS; } // ----- Virtual method Finish ----------------------------------------- void CbmMvdDigitizer::Finish() -{ //Int_t i = DetectPlugin (100); - //LOG(debug) << "CbmMvdDigitizer::Finish() Autodetect: " << i <<" Manual Detect " << fDigiPluginNr; - // LOG(debug) << "finishing"; +{ Int_t i = DetectPlugin (100); + LOG(debug) << "CbmMvdDigitizer::Finish() Autodetect: " << i <<" Manual Detect " << fDigiPluginNr; + LOG(debug) << "finishing"; + LOG(debug) << "Trying to show Histograms: " << fShowDebugHistos; + + if(fShowDebugHistos){ + CollectHistograms(); + //DisplayDebugHistos(); + SafeDebugHistosToFile("TestHistoFile.root"); + } + + LOG(debug) << "Histograms completed"; + fDetector->Finish(); PrintParameters(); } + +// ------------------------------------------------------------------------- + +void CbmMvdDigitizer::CollectHistograms() { + + // detect correct plugin in the Task-array + + Int_t nTargetPlugin=DetectPlugin(100); + LOG(debug) << "CbmMvdDigitizer::CollectHistograms - Targeting nTargetPlugin= " << nTargetPlugin; + + + if(!fHistoArray) { + LOG(debug) << "CbmMvdDigitizer::CollectHistograms - Created new TObjArray"; + fHistoArray=new TObjArray(); + + + + } + else { + LOG(debug) << "CbmMvdDigitizer::CollectHistograms - Cleared new TObjArray"; + fHistoArray->Clear(); + + + }; //initialize array without deleting histograms by themselves + + for(UInt_t i=0; i<fDetector->GetMaxHistoNumber(nTargetPlugin); i++){ + + // This all histograms in the sensors + LOG(debug) << "CbmMvdDigitizer::CollectHistograms - Trying to read histogram "<<i; + fHistoArray->AddLast((TObject*)fDetector->GetHistogram(nTargetPlugin,i)); + + } + + + + + +}; + +// ------------------------------------------------------------------------- +// Function to display histograms at Finish, must call ShowDebugHistograms before. +void CbmMvdDigitizer::DisplayDebugHistos() { + + TCanvas* c = 0; + char myChar=0; + + //c->Divide(3, 3); + if (!fHistoArray) {LOG(info) << "CbmMvdDigitizer::DisplayDebugHistos - Error: fHistoArray not initialized. Disabling histograms."; return;} + for(Int_t i=0; i<9; i++){ + if (i>=fHistoArray->GetEntriesFast()){continue;} + LOG(debug) << "Trying to display histogram" << i; + myChar=48+(char)i; + TString myCanvasName= "DigiCanvas"+myChar; + LOG(debug) << "Trying to generate Canvas with name" << myCanvasName; + c=new TCanvas(myCanvasName, myCanvasName, 150, 10, 800, 600); + + //c-> cd(i); + ((TH1*)fHistoArray->At(i))->Draw(); + + + } + //LOG(info) << "CbmMvdDigitizerL::Finish - Fit of the total cluster charge"; + //fTotalChargeHisto->Fit("landau"); + + //c->Draw(); +}; + // ------------------------------------------------------------------------- +// Function safes histograms to file, must call ShowDebugHistograms before. + + +void CbmMvdDigitizer::SafeDebugHistosToFile(TString histoFile) { + + if (!fHistoArray) {LOG(info) << "CbmMvdDigitizerL::SafeDebugHistosToFile - Error: fHistoArray not initialized. Disabling histograms."; return;} + TFile* gFileCopy=gFile; + TFile* myFile=new TFile(histoFile,"Recreate"); + LOG(info) << "CbmMvdDigitizer::SafeDebugHistosToFile - Writing histograms to file: " << histoFile; + + for (Int_t i=0;i<fHistoArray->GetEntriesFast(); i++) { + + LOG(debug) << "CbmMvdDigitizer::SafeDebugHistosToFil - Saving histogram number " << i; + ((TH1*)fHistoArray->At(i))->Write();} + myFile->Close(); + gFile=gFileCopy; + + +}; + // ----- Private method Reset ------------------------------------------ diff --git a/sim/detectors/mvd/CbmMvdDigitizer.h b/sim/detectors/mvd/CbmMvdDigitizer.h index b973b0a9158622b6a9e3ab09106f52b27c93cd2e..b71fe7b704a8291056f0f70ed0c042ec3f1645a1 100644 --- a/sim/detectors/mvd/CbmMvdDigitizer.h +++ b/sim/detectors/mvd/CbmMvdDigitizer.h @@ -72,7 +72,12 @@ public: } // set the misalignment in cm void BuildEvent(); - void ShowDebugHistograms() { fShowDebugHistos = kTRUE; } + void ShowDebugHistograms() { fShowDebugHistos = kTRUE; } // Requests Task to create the histograms. Call before calling Init() + void DisplayDebugHistos() ; // Function to display histograms at Finish, must call ShowDebugHistograms before. + void SafeDebugHistosToFile(TString histoFile); // Function safes histograms to file, must call ShowDebugHistograms before. + void CollectHistograms(); // Collects histograms from the sensors and safes them in TObjArray* fHistoArray. + // Histos are NOT copied, copy manually if wanted. + TObjArray* GetHistograms(){return fHistoArray;}; // Access to Histos. They are NOT copied, clone manually if wanted. void SetProduceNoise() { fNoiseSensors = kTRUE; }; Int_t DetectPlugin(Int_t pluginID); @@ -82,6 +87,32 @@ public: virtual void ResetArrays(); + /** Intialisation **/ + virtual InitStatus Init(); + + + /** Reinitialisation **/ + virtual InitStatus ReInit(); + + + /** Virtual method Finish **/ + virtual void Finish(); + + + /** Register the output arrays to the IOManager **/ + void Register(); + + void GetMvdGeometry(); + + + /** Clear the hit arrays **/ + void Reset(); + + + /** Print digitisation parameters **/ + void PrintParameters() const; + std::string ParametersToString() const; + private: /** Hit producer mode (0 = MAPS, 1 = Ideal) **/ Int_t fMode; @@ -97,6 +128,8 @@ private: TClonesArray* fTmpMatch; //! Temporary TClonesArray to absorb from MvdDetector TClonesArray* fTmpDigi; //! Temporary TClonesArray to absorb from MvdDetector + TObjArray* fHistoArray; + std::vector<CbmMvdDigi*> fDigiVect; //! Temporary storage for CbmDaq std::vector<CbmMatch*> fMatchVect; //! Temporary storage for CbmDaq @@ -114,6 +147,7 @@ private: TString fInputBranchName; // Name of input branch (MvdPoint) TString fBgFileName; // Name of background (pileup) file TString fDeltaFileName; // Name of the file containing delta electrons + TString fHistoFileName; TStopwatch fTimer; ///< ROOT timer @@ -123,33 +157,8 @@ private: CbmMvdPileupManager* fDeltaManager; - // ----- Private methods --------------------------------------------- - /** Intialisation **/ - virtual InitStatus Init(); - - - /** Reinitialisation **/ - virtual InitStatus ReInit(); - /** Virtual method Finish **/ - virtual void Finish(); - - - /** Register the output arrays to the IOManager **/ - void Register(); - - void GetMvdGeometry(); - - - /** Clear the hit arrays **/ - void Reset(); - - - /** Print digitisation parameters **/ - void PrintParameters() const; - std::string ParametersToString() const; - private: CbmMvdDigitizer(const CbmMvdDigitizer&); CbmMvdDigitizer operator=(const CbmMvdDigitizer&); diff --git a/sim/detectors/mvd/plugins/tasks/CbmMvdSensorDigitizerTask.cxx b/sim/detectors/mvd/plugins/tasks/CbmMvdSensorDigitizerTask.cxx index 7505e01fa5959e18290f8e5d510f757cfef8b7b1..977b0aed98cd7bd8bde3dbe0c47d8f1873c541dc 100644 --- a/sim/detectors/mvd/plugins/tasks/CbmMvdSensorDigitizerTask.cxx +++ b/sim/detectors/mvd/plugins/tasks/CbmMvdSensorDigitizerTask.cxx @@ -1054,7 +1054,7 @@ void CbmMvdSensorDigitizerTask::ProducePixelCharge(CbmMvdPoint* point) // + 0.25 * fPar1 * fPar1) // + fPar2); - totCharge= sPoint->charge * fLorentzNorm * + Float_t totCharge= sPoint->charge * fLorentzNorm * fSensorDataSheet-> ComputeCCE(xCentre, yCentre, 0, Current[0], Current[1],0); if (totCharge < 1) { @@ -1237,6 +1237,7 @@ void CbmMvdSensorDigitizerTask::InitTask(CbmMvdSensor* mySensor) // Initialize histogramms used for debugging if (fShowDebugHistos) { + fHistoArray=new TObjArray(); LOG(info) << "Show debug histos in this Plugin"; fRandomGeneratorTestHisto = new TH1F("TestHisto", "TestHisto", 1000, 0, 12000); fResolutionHistoX = new TH1F("DigiResolutionX", "DigiResolutionX", 1000, -.005, .005); @@ -1250,6 +1251,22 @@ void CbmMvdSensorDigitizerTask::InitTask(CbmMvdSensor* mySensor) fSegResolutionHistoZ = new TH1F("SegmentResolutionZ", "SegmentResolutionZ", 1000, -.005, .005); fTotalChargeHisto = new TH1F("TotalChargeHisto", "TotalChargeHisto", 1000, 0, 12000); fTotalSegmentChargeHisto = new TH1F("TotalSegmentChargeHisto", "TotalSegmentChargeHisto", 1000, 0, 12000); + + // Push histograms into the related array as required for communicating them to the steering classes (CbmMvdDetector, FairTask) + fHistoArray->AddLast(fRandomGeneratorTestHisto); + fHistoArray->AddLast(fResolutionHistoX); + fHistoArray->AddLast(fResolutionHistoY); + fHistoArray->AddLast(fPosXY); + fHistoArray->AddLast(fpZ); + fHistoArray->AddLast(fPosXinIOut); + fHistoArray->AddLast(fAngle); + fHistoArray->AddLast(fSegResolutionHistoX); + fHistoArray->AddLast(fSegResolutionHistoY); + fHistoArray->AddLast(fSegResolutionHistoZ); + fHistoArray->AddLast(fTotalChargeHisto); + fHistoArray->AddLast(fTotalSegmentChargeHisto); + + } /** Screen output **/ @@ -1281,7 +1298,7 @@ void CbmMvdSensorDigitizerTask::Finish() // PrintParameters(); - if (fShowDebugHistos) { + if (kFALSE&&fShowDebugHistos) { // Finish code of initial FairTask. Switched off right now. TCanvas* c = new TCanvas("DigiCanvas", "DigiCanvas", 150, 10, 800, 600); c->Divide(3, 3); c->cd(1);