From 895a2c593e67853aba1f53da72a6585fbf403158 Mon Sep 17 00:00:00 2001
From: Apar Agarwal <a.agarwal@vecc.gov.in>
Date: Wed, 6 Dec 2023 15:12:29 +0530
Subject: [PATCH] Clang format

---
 sim/detectors/much/CbmMuchDigitizeGem.cxx | 381 ++++++++++++----------
 1 file changed, 206 insertions(+), 175 deletions(-)

diff --git a/sim/detectors/much/CbmMuchDigitizeGem.cxx b/sim/detectors/much/CbmMuchDigitizeGem.cxx
index b537f78bef..05b89110b8 100644
--- a/sim/detectors/much/CbmMuchDigitizeGem.cxx
+++ b/sim/detectors/much/CbmMuchDigitizeGem.cxx
@@ -8,8 +8,13 @@
  *@version 4.0
  *@description: Using std::vector for digi and match containers.
  *@author Ekata Nandy (ekata@vecc.gov.in)
- *@since 21.06.19 : RPC digitization parameters(for 3rd and 4th MUCH station) now have been implemented along with GEM param// eters (1st and 2nd station) @author Ekata Nandy (ekata@vecc.gov.in)
- *@description: ADC channels number is 32.GEM & RPC has different charge threshold value and dynamic range, so SetAdc has been changed acc// ordingly. ADC value starts from 1 to 32. ADC 0 has been excluded as it gives wrong x, y, t. @author Ekata Nandy
+ *@since 21.06.19 : RPC digitization parameters(for 3rd and 4th MUCH station)
+ *now have been implemented along with GEM param// eters (1st and 2nd station)
+ *@author Ekata Nandy (ekata@vecc.gov.in)
+ *@description: ADC channels number is 32.GEM & RPC has different charge
+ *threshold value and dynamic range, so SetAdc has been changed acc// ordingly.
+ *ADC value starts from 1 to 32. ADC 0 has been excluded as it gives wrong x, y,
+ *t. @author Ekata Nandy
  *@author Vikas Singhal <vikas@vecc.gov.in>
  *@since 01.10.16
  *@version 2.0
@@ -20,7 +25,8 @@
  *@since 19.03.07
  *@version 1.0
  **
- ** CBM task class for digitizing MUCH for both Event by event and Time based mode.
+ ** CBM task class for digitizing MUCH for both Event by event and Time based
+ *mode.
  ** Task level RECO
  ** Produces objects of type CbmMuchDigi out of CbmMuchPoint.
  **/
@@ -80,20 +86,19 @@ using std::setprecision;
 using std::setw;
 using std::string;
 
-
 // -----   Default constructor   -------------------------------------------
 CbmMuchDigitizeGem::CbmMuchDigitizeGem()
   : CbmDigitize<CbmMuchDigi>("MuchDigitizeGem")
   ,
-  //fgDeltaResponse(),
+  // fgDeltaResponse(),
   fAlgorithm(1)
   , fGeoScheme(CbmMuchGeoScheme::Instance())
   , fDigiFile()
   , fPoints(NULL)
   , fMCTracks(NULL)
   ,
-  //fDigis(NULL),
-  //fDigiMatches(NULL),
+  // fDigis(NULL),
+  // fDigiMatches(NULL),
   fNFailed(0)
   , fNOutside(0)
   , fNMulti(0)
@@ -111,8 +116,8 @@ CbmMuchDigitizeGem::CbmMuchDigitizeGem()
   , fDeadTime(400)
   , fDriftVelocity(-1)
   ,
-  //fPeakingTime(20),
-  //fRemainderTime(40),
+  // fPeakingTime(20),
+  // fRemainderTime(40),
   fTimeBinWidth(1)
   , fNTimeBins(200)
   , fTOT(0)
@@ -122,7 +127,10 @@ CbmMuchDigitizeGem::CbmMuchDigitizeGem()
   fSigma()
   , fMPV()
   , fIsLight(1)
-  ,  // fIsLight = 1 (default) Store Light CbmMuchDigiMatch in output branch, fIsLight = 0 Create Heavy CbmMuchDigiMatch with fSignalShape info.
+  ,
+  // fIsLight = 1 (default) Store Light CbmMuchDigiMatch in
+  // output branch, fIsLight = 0 Create Heavy CbmMuchDigiMatch
+  // with fSignalShape info.
   fTimePointLast(-1)
   , fTimeDigiFirst(-1)
   , fTimeDigiLast(-1)
@@ -159,26 +167,25 @@ CbmMuchDigitizeGem::CbmMuchDigitizeGem()
   fMPV[2] = new TF1("mpv_p", "pol6", -5, 10);
   fMPV[2]->SetParameters(mpv_p);
   Reset();
-  fNoiseCharge =
-    new TF1("Noise Charge", "TMath::Gaus(x, [0], [1])", fQThreshold,
-            fQMax / 10);  //noise function to calculate charge for noise hit. mean=fQThreashold(10000),fQMax=500000
+  fNoiseCharge = new TF1("Noise Charge", "TMath::Gaus(x, [0], [1])", fQThreshold,
+                         fQMax / 10);  // noise function to calculate charge for noise hit.
+                                       // mean=fQThreashold(10000),fQMax=500000
 }
 // -------------------------------------------------------------------------
 
-
 // -------------------------------------------------------------------------
 CbmMuchDigitizeGem::CbmMuchDigitizeGem(const char* digiFileName, Int_t flag)
   : CbmDigitize<CbmMuchDigi>("MuchDigitizeGem")
   ,
-  //fgDeltaResponse(),
+  // fgDeltaResponse(),
   fAlgorithm(1)
   , fGeoScheme(CbmMuchGeoScheme::Instance())
   , fDigiFile(digiFileName)
   , fPoints(NULL)
   , fMCTracks(NULL)
   ,
-  //fDigis(NULL),
-  //fDigiMatches(NULL),
+  // fDigis(NULL),
+  // fDigiMatches(NULL),
   fNFailed(0)
   , fNOutside(0)
   , fNMulti(0)
@@ -196,8 +203,8 @@ CbmMuchDigitizeGem::CbmMuchDigitizeGem(const char* digiFileName, Int_t flag)
   , fDeadTime(400)
   , fDriftVelocity(-1)
   ,
-  //fPeakingTime(20),
-  //fRemainderTime(40),
+  // fPeakingTime(20),
+  // fRemainderTime(40),
   fTimeBinWidth(1)
   , fNTimeBins(200)
   , fTOT(0)
@@ -207,7 +214,10 @@ CbmMuchDigitizeGem::CbmMuchDigitizeGem(const char* digiFileName, Int_t flag)
   fSigma()
   , fMPV()
   , fIsLight(1)
-  ,  // fIsLight = 1 (default) Store Light CbmMuchDigiMatch in output branch, fIsLight = 0 Create Heavy CbmMuchDigiMatch with fSignalShape info.
+  ,
+  // fIsLight = 1 (default) Store Light CbmMuchDigiMatch in
+  // output branch, fIsLight = 0 Create Heavy CbmMuchDigiMatch
+  // with fSignalShape info.
   fTimePointLast(-1)
   , fTimeDigiFirst(-1)
   , fTimeDigiLast(-1)
@@ -244,13 +254,12 @@ CbmMuchDigitizeGem::CbmMuchDigitizeGem(const char* digiFileName, Int_t flag)
   fMPV[2] = new TF1("mpv_p", "pol6", -5, 10);
   fMPV[2]->SetParameters(mpv_p);
   Reset();
-  fNoiseCharge =
-    new TF1("Noise Charge", "TMath::Gaus(x, [0], [1])", fQThreshold,
-            fQMax / 10);  //noise function to calculate charge for noise hit. mean=fQThreashold(10000),fQMax=500000
+  fNoiseCharge = new TF1("Noise Charge", "TMath::Gaus(x, [0], [1])", fQThreshold,
+                         fQMax / 10);  // noise function to calculate charge for noise hit.
+                                       // mean=fQThreashold(10000),fQMax=500000
 }
 // -------------------------------------------------------------------------
 
-
 // -----   Destructor   ----------------------------------------------------
 CbmMuchDigitizeGem::~CbmMuchDigitizeGem()
 {
@@ -264,7 +273,6 @@ CbmMuchDigitizeGem::~CbmMuchDigitizeGem()
 }
 // -------------------------------------------------------------------------
 
-
 // -----   Private method Reset   -------------------------------------------
 void CbmMuchDigitizeGem::Reset()
 {
@@ -273,7 +281,8 @@ void CbmMuchDigitizeGem::Reset()
 }
 // -------------------------------------------------------------------------
 
-// -----   Setting Detector related parameters   -------------------------------------------
+// -----   Setting Detector related parameters
+// -------------------------------------------
 void CbmMuchDigitizeGem::DetectorParameters(CbmMuchModule* module)
 {
   Int_t DetectorType = module->GetDetectorType();
@@ -293,7 +302,7 @@ void CbmMuchDigitizeGem::DetectorParameters(CbmMuchModule* module)
       auto DriftVolumeWidth = module->GetSize().Z();                      // Drift gap
       fTotalDriftTime       = DriftVolumeWidth / fDriftVelocity * 10000;  // Drift time (ns)
     } break;
-    case 4: {                          //For RPC
+    case 4: {                          // For RPC
       fNADCChannels         = 32;      // Total ADC Channels
       fQMax                 = 812500;  // Maximum charge = 130 fC for RPC
       fQThreshold           = 187500;  // Minimum charge threshold = 30 fC for RPC
@@ -312,12 +321,10 @@ void CbmMuchDigitizeGem::DetectorParameters(CbmMuchModule* module)
 }
 // -------------------------------------------------------------------------
 
-
 // -----   Private method Init   -------------------------------------------
 InitStatus CbmMuchDigitizeGem::Init()
 {
 
-
   // Screen output
   std::cout << std::endl;
   LOG(info) << "==========================================================";
@@ -326,10 +333,13 @@ InitStatus CbmMuchDigitizeGem::Init()
   FairRootManager* ioman = FairRootManager::Instance();
   if (!ioman) Fatal("Init", "No FairRootManager");
 
-  if (fEventMode) { LOG(info) << fName << ": Using event-by-event mode"; }
+  if (fEventMode) {
+    LOG(info) << fName << ": Using event-by-event mode";
+  }
 
-  //  hPriElAfterDriftpathgem = new TH1D("hPriElAfterDriftpathgem"," GEM:primary electron ",300,0,300);
-  //  hPriElAfterDriftpathrpc = new TH1D("hPriElAfterDriftpathrpc"," RPC:primary electron ",300,0,300);
+  //  hPriElAfterDriftpathgem = new TH1D("hPriElAfterDriftpathgem"," GEM:primary
+  //  electron ",300,0,300); hPriElAfterDriftpathrpc = new
+  //  TH1D("hPriElAfterDriftpathrpc"," RPC:primary electron ",300,0,300);
   //  hadcGEM = new TH1F("hadcGEM","GEM:ADC",70,-0.5,69.5);
   // hadcRPC = new TH1F("hadcRPC","RPC:ADC",70,-0.5,69.5);
 
@@ -343,7 +353,9 @@ InitStatus CbmMuchDigitizeGem::Init()
   for (Int_t iNode = 0; iNode < cave->GetNdaughters(); iNode++) {
     TString name = cave->GetDaughter(iNode)->GetVolume()->GetName();
     if (name.Contains("much", TString::kIgnoreCase)) {
-      if (name.Contains("mcbm", TString::kIgnoreCase)) { geoTag = TString(name(5, name.Length())); }
+      if (name.Contains("mcbm", TString::kIgnoreCase)) {
+        geoTag = TString(name(5, name.Length()));
+      }
       else {
         geoTag = TString(name(5, name.Length() - 5));
       }
@@ -354,10 +366,12 @@ InitStatus CbmMuchDigitizeGem::Init()
     }  //? node is MUCH
   }    //# top level nodes
 
-
   // Set the parameter file and the flag, if not done in constructor
   if (fDigiFile.IsNull()) {
-    if (geoTag.IsNull()) LOG(fatal) << fName << ": no parameter file specified and no MUCH node found in geometry!";
+    if (geoTag.IsNull())
+      LOG(fatal) << fName
+                 << ": no parameter file specified and no MUCH node found in "
+                    "geometry!";
     fDigiFile = gSystem->Getenv("VMCWORKDIR");
     // TODO: (VF) A better naming convention for the geometry tag and the
     // corresponding parameter file is surely desirable.
@@ -367,7 +381,8 @@ InitStatus CbmMuchDigitizeGem::Init()
     else {
       fDigiFile += "/parameters/much/much_" + geoTag(0, 4) + "_digi_sector.root";
     }
-    // fDigiFile ="/home/ekata/CbmRoot/AUG18/parameters/much/much_v17b_digi_sector.root";
+    // fDigiFile
+    // ="/home/ekata/CbmRoot/AUG18/parameters/much/much_v17b_digi_sector.root";
 
     LOG(info) << fName << ": Using parameter file " << fDigiFile;
 
@@ -390,7 +405,8 @@ InitStatus CbmMuchDigitizeGem::Init()
   gDirectory = oldDir;
   fGeoScheme->Init(stations, fFlag);
 
-  //For X, Y position correction according to different geometry file and its tag.
+  // For X, Y position correction according to different geometry file and its
+  // tag.
   if (fDigiFile.Contains("mcbm")) {
     if (fDigiFile.Contains("v19a")) {
       fGemTX = 18.5;
@@ -400,13 +416,15 @@ InitStatus CbmMuchDigitizeGem::Init()
       fGemTX = 18.5;
       fGemTY = 80.0;
     }
-    else if (fDigiFile.Contains("v22j")) {  // for high intensity runs during June 2022 mMuCh in acceptance
+    else if (fDigiFile.Contains("v22j")) {  // for high intensity runs during
+                                            // June 2022 mMuCh in acceptance
       fGemTX = 8.0;
       fGemTY = 81.5;
-      fRpcTX = 66.25;  //RPC introduced during 2022 data taking
+      fRpcTX = 66.25;  // RPC introduced during 2022 data taking
       fRpcTY = -70.5;
     }
-    else if (fDigiFile.Contains("v22k")) {  // during benchmark runs. mMuCh is out of acceptance
+    else if (fDigiFile.Contains("v22k")) {  // during benchmark runs. mMuCh is
+                                            // out of acceptance
       fGemTX = -44.5;
       fGemTY = 81.5;
       fRpcTX = 48.0;
@@ -415,12 +433,13 @@ InitStatus CbmMuchDigitizeGem::Init()
   }
 
   // Determine drift volume width
-  // Double_t driftVolumeWidth = 0.4; // cm - default and will over written by Detector Parameters function.
+  // Double_t driftVolumeWidth = 0.4; // cm - default and will over written by
+  // Detector Parameters function.
 
   // Double_t DriftVolumeWidth;
   for (Int_t i = 0; i < fGeoScheme->GetNStations(); i++) {
     CbmMuchStation* station = fGeoScheme->GetStation(i);
-    //CbmMuchStation* station = fGeoScheme->GetStation(3);
+    // CbmMuchStation* station = fGeoScheme->GetStation(3);
     if (station->GetNLayers() <= 0) continue;
     CbmMuchLayerSide* side = station->GetLayer(0)->GetSide(0);
     if (side->GetNModules() <= 0) continue;
@@ -428,10 +447,12 @@ InitStatus CbmMuchDigitizeGem::Init()
     //    if (module->GetDetectorType()!=4)continue;
     if (module->GetDetectorType() != 3 && module->GetDetectorType() != 4) continue;
     DetectorParameters(module);
-    //cout<<" dec type "<<module->GetDetectorType()<<" drift width "<<DriftVolumeWidth<<endl;
+    // cout<<" dec type "<<module->GetDetectorType()<<" drift width
+    // "<<DriftVolumeWidth<<endl;
   }
 
-  //  cout<<" dec type "<<module->GetDetectorType()<<" drift width "<<driftVolumeWidth<<endl;
+  //  cout<<" dec type "<<module->GetDetectorType()<<" drift width
+  //  "<<driftVolumeWidth<<endl;
   /*
      driftVolumeWidth = module->GetSize().Z();
   cout<<"driftVolumeWidth "<<driftVolumeWidth<<endl;
@@ -441,7 +462,7 @@ InitStatus CbmMuchDigitizeGem::Init()
   fTotalDriftTime = driftVolumeWidth/fDriftVelocity*10000; // [ns];
 */
 
-  //Reading MC point as Event by event for time based digi generation also.
+  // Reading MC point as Event by event for time based digi generation also.
   // Get input array of MuchPoints
   fPoints = (TClonesArray*) ioman->GetObject("MuchPoint");
   assert(fPoints);
@@ -455,8 +476,9 @@ InitStatus CbmMuchDigitizeGem::Init()
   fDigis = new std::vector<CbmMuchDigi>();
   ioman->RegisterAny("MuchDigi",fDigis, IsOutputBranchPersistent("MuchDigi"));
   if ( fCreateMatches ) {
-	fDigiMatches = new std::vector<CbmMatch>();
-	ioman->RegisterAny("MuchDigiMatch",fDigiMatches, IsOutputBranchPersistent("MuchDigiMatch"));
+        fDigiMatches = new std::vector<CbmMatch>();
+        ioman->RegisterAny("MuchDigiMatch",fDigiMatches,
+  IsOutputBranchPersistent("MuchDigiMatch"));
   }
   */
   RegisterOutput();
@@ -468,17 +490,18 @@ InitStatus CbmMuchDigitizeGem::Init()
     fDigiMatches = new TClonesArray("CbmMatch", 1000);
     ioman->Register("MuchDigiMatch", "Digi Match in MUCH", fDigiMatches, kTRUE);
   }*/
-  //fgDeltaResponse is used in the CbmMuchSignal for analysing the Signal Shape,
-  //it is generated once in the digitizer and then be used by each CbmMuchSignal.
-  //For reducing the time therefore generated once in the CbmMuchDigitize Gem and
-  //not generated in the CbmMuchSignal
+  // fgDeltaResponse is used in the CbmMuchSignal for analysing the Signal
+  // Shape, it is generated once in the digitizer and then be used by each
+  // CbmMuchSignal. For reducing the time therefore generated once in the
+  // CbmMuchDigitize Gem and not generated in the CbmMuchSignal
   // Set response on delta function
 
-  // Not using fSignalShape as consuming memory. Commening all the field related.
+  // Not using fSignalShape as consuming memory. Commening all the field
+  // related.
 
-  //Int_t nShapeTimeBins=Int_t(gkResponsePeriod/gkResponseBin);
-  //fgDeltaResponse.Set(nShapeTimeBins);
-  //for (Int_t i=0;i<fgDeltaResponse.GetSize();i++){
+  // Int_t nShapeTimeBins=Int_t(gkResponsePeriod/gkResponseBin);
+  // fgDeltaResponse.Set(nShapeTimeBins);
+  // for (Int_t i=0;i<fgDeltaResponse.GetSize();i++){
   //  Double_t time = i*gkResponseBin;
   //  if (time<=fPeakingTime) fgDeltaResponse[i]=time/fPeakingTime;
   //  else fgDeltaResponse[i] = exp(-(time-fPeakingTime)/fRemainderTime);
@@ -497,7 +520,8 @@ InitStatus CbmMuchDigitizeGem::Init()
   }
 
   // --- Enable histogram if want to enalyze Noise spectrum.
-  //noise = new TH1D("noise", "Noise Generated per Event NoiseRate 10e-8", 100 , 0 , 200);
+  // noise = new TH1D("noise", "Noise Generated per Event NoiseRate 10e-8", 100
+  // , 0 , 200);
   LOG(info) << GetName() << ": Initialisation successful";
   LOG(info) << "==========================================================";
   std::cout << std::endl;
@@ -506,7 +530,6 @@ InitStatus CbmMuchDigitizeGem::Init()
 }
 // -------------------------------------------------------------------------
 
-
 // -----   Public method Exec   --------------------------------------------
 void CbmMuchDigitizeGem::Exec(Option_t*)
 {
@@ -520,7 +543,7 @@ void CbmMuchDigitizeGem::Exec(Option_t*)
   LOG(debug) << GetName() << ": Processing event " << fCurrentEvent << " from input " << fCurrentInput
              << " at t = " << fCurrentEventTime << " ns with " << fPoints->GetEntriesFast() << " MuchPoints ";
 
-  //ReadAndRegister(fCurrentEventTime);
+  // ReadAndRegister(fCurrentEventTime);
 
   for (Int_t iPoint = 0; iPoint < fPoints->GetEntriesFast(); iPoint++) {
     const CbmMuchPoint* point = (const CbmMuchPoint*) fPoints->At(iPoint);
@@ -530,12 +553,13 @@ void CbmMuchDigitizeGem::Exec(Option_t*)
     fNofPoints++;
   }  // MuchPoint loop
 
-  // --------------------NOISE Generated before ReadAndRegister---------------------- //
+  // --------------------NOISE Generated before
+  // ReadAndRegister---------------------- //
   if (fGenerateElectronicsNoise) {
     fPreviousEventTime = fNofEvents ? fPreviousEventTime : 0.;
     Int_t nNoise       = GenerateNoise(fPreviousEventTime, fCurrentEventTime);
     fNofNoiseTot += nNoise;
-    //noise->Fill(nNoise);
+    // noise->Fill(nNoise);
     LOG(info) << "+ " << setw(20) << GetName() << ": Generated  " << nNoise
               << " noise signals from t = " << fPreviousEventTime << " ns to " << fCurrentEventTime << " ns and "
               << fNofNoiseTot << " total noise generated till now.";
@@ -545,8 +569,8 @@ void CbmMuchDigitizeGem::Exec(Option_t*)
     fPreviousEventTime = fCurrentEventTime;
   }
 
-
-  if (fEventMode) ReadAndRegister(-1);
+  if (fEventMode)
+    ReadAndRegister(-1);
   else
     ReadAndRegister(fCurrentEventTime);
 
@@ -555,7 +579,6 @@ void CbmMuchDigitizeGem::Exec(Option_t*)
             << setprecision(3) << fCurrentEventTime << " ns, points: " << fNofPoints << ", signals: " << fNofSignals
             << ", digis: " << fNofDigis << ". Exec time " << setprecision(6) << fTimer.RealTime() << " s.";
 
-
   fTimer.Stop();
   fNofEvents++;
   fNofPointsTot += fNofPoints;
@@ -565,8 +588,8 @@ void CbmMuchDigitizeGem::Exec(Option_t*)
 
 }  // -----------------------------------------------------------------------------------------
 
-
-//================================Generte Noise==============================================//
+//================================Generate
+// Noise==============================================//
 Int_t CbmMuchDigitizeGem::GenerateNoise(Double_t t1, Double_t t2)
 {
   LOG(debug) << "+ " << setw(20) << GetName() << ": Previous event time " << t1 << " Current event time " << t2
@@ -593,7 +616,7 @@ Int_t CbmMuchDigitizeGem::GenerateNoise(Double_t t1, Double_t t2)
       auto FrontModuleNoise = 0;
       for (auto k = 0; k < numberofmodules; k++) {
         CbmMuchModuleGem* module = (CbmMuchModuleGem*) (side->GetModule(k));
-        if (module->GetDetectorType() != 4 && module->GetDetectorType() != 3) continue;  ///modified for rpc
+        if (module->GetDetectorType() != 4 && module->GetDetectorType() != 3) continue;  /// modified for rpc
         FrontModuleNoise += GenerateNoisePerModule(module, t1, t2);
       }
       side            = station->GetLayer(j)->GetSide(1);
@@ -602,7 +625,7 @@ Int_t CbmMuchDigitizeGem::GenerateNoise(Double_t t1, Double_t t2)
       auto BackModuleNoise = 0;
       for (auto k = 0; k < numberofmodules; k++) {
         CbmMuchModuleGem* module = (CbmMuchModuleGem*) side->GetModule(k);
-        if (module->GetDetectorType() != 4 && module->GetDetectorType() != 3) continue;  ///modified for rpc
+        if (module->GetDetectorType() != 4 && module->GetDetectorType() != 3) continue;  /// modified for rpc
         BackModuleNoise += GenerateNoisePerModule(module, t1, t2);
       }
       LayerNoise += FrontModuleNoise + BackModuleNoise;
@@ -614,7 +637,8 @@ Int_t CbmMuchDigitizeGem::GenerateNoise(Double_t t1, Double_t t2)
   return StationNoise;
 }
 
-//================================Generte Noise==============================================//
+//================================Generate
+// Noise==============================================//
 
 Int_t CbmMuchDigitizeGem::GenerateNoisePerModule(CbmMuchModuleGem* module, Double_t t1, Double_t t2)
 {
@@ -631,7 +655,7 @@ Int_t CbmMuchDigitizeGem::GenerateNoisePerModule(CbmMuchModuleGem* module, Doubl
       charge = fNoiseCharge->GetRandom();
     AddNoiseSignal(pad, NoiseTime, charge);
   }
-  //noise->Fill(nNoise);
+  // noise->Fill(nNoise);
   return nNoise;
 }
 
@@ -646,8 +670,8 @@ void CbmMuchDigitizeGem::AddNoiseSignal(CbmMuchPad* pad, Double_t time, Double_t
   //  << channel;
   //  return;
   CbmMuchSignal* signal = new CbmMuchSignal(pad->GetAddress(), time);
-  //signal->SetTimeStart(time);
-  //signal->SetTimeStop(time+fDeadTime);
+  // signal->SetTimeStart(time);
+  // signal->SetTimeStop(time+fDeadTime);
   signal->SetCharge((UInt_t) charge);
   UInt_t address = pad->GetAddress();
   CbmMuchReadoutBuffer::Instance()->Fill(address, signal);
@@ -660,11 +684,13 @@ void CbmMuchDigitizeGem::AddNoiseSignal(CbmMuchPad* pad, Double_t time, Double_t
 //====================End of Noise part=================//
 
 // -------------------------------------------------------------------------
-//Read all the Signal from CbmMuchReadoutBuffer, convert the analog signal into the digital response  and register Output according to event by event mode and Time based mode.
+// Read all the Signal from CbmMuchReadoutBuffer, convert the analog signal into
+// the digital response  and register Output according to event by event mode
+// and Time based mode.
 void CbmMuchDigitizeGem::ReadAndRegister(Long_t eventTime)
 {
   std::vector<CbmMuchSignal*> SignalList;
-  //Event Time should be passed with the Call
+  // Event Time should be passed with the Call
   /*Double_t eventTime = -1.;
     if(fDaq){
     eventTime = FairRun::Instance()->GetEventHeader()->GetEventTime();
@@ -677,8 +703,10 @@ void CbmMuchDigitizeGem::ReadAndRegister(Long_t eventTime)
   for (std::vector<CbmMuchSignal*>::iterator LoopOver = SignalList.begin(); LoopOver != SignalList.end(); LoopOver++) {
     CbmMuchDigi* digi   = ConvertSignalToDigi(*LoopOver);
     CbmMatch* digiMatch = new CbmMatch(*(*LoopOver)->GetMatch());  // must be copied from signal
-    //assert(digi);
-    if (!digi) { LOG(debug2) << GetName() << ": Digi not created as signal is below threshold."; }
+    // assert(digi);
+    if (!digi) {
+      LOG(debug2) << GetName() << ": Digi not created as signal is below threshold.";
+    }
     else {
       LOG(debug2) << GetName() << ": New digi: sector = " << CbmMuchAddress::GetSectorIndex(digi->GetAddress())
                   << " channel= " << CbmMuchAddress::GetChannelIndex(digi->GetAddress());
@@ -701,12 +729,12 @@ void CbmMuchDigitizeGem::ReadAndRegister(Long_t eventTime)
 
 }  //----ReadAndRegister -------
 
-//Convert Signal into the Digi with appropriate methods.
+// Convert Signal into the Digi with appropriate methods.
 
 CbmMuchDigi* CbmMuchDigitizeGem::ConvertSignalToDigi(CbmMuchSignal* signal)
 {
 
-  //Setting Parameters for RPC or GEM (10 lines)
+  // Setting Parameters for RPC or GEM (10 lines)
   auto address            = signal->GetAddress();
   auto StationIndex       = CbmMuchAddress::GetStationIndex(address);
   CbmMuchStation* station = fGeoScheme->GetStation(StationIndex);
@@ -718,29 +746,39 @@ CbmMuchDigi* CbmMuchDigitizeGem::ConvertSignalToDigi(CbmMuchSignal* signal)
   assert(module);
   DetectorParameters(module);
 
-  //  cout<<"Det Type: "<<module->GetDetectorType()<<" fQThreshold "<<fQThreshold<<" fqmax "<<fQMax<<" drift time "<<fTotalDriftTime<<" drift vel "<<fDriftVelocity<<" spot radius "<<fSpotRadius<<endl;
-  //cout<<"fQThreshold "<<fQThreshold<<" fqmax "<<fQMax<<endl;
-  //signal below threshold should be discarded.
+  //  cout<<"Det Type: "<<module->GetDetectorType()<<" fQThreshold
+  //  "<<fQThreshold<<" fqmax "<<fQMax<<" drift time "<<fTotalDriftTime<<" drift
+  //  vel "<<fDriftVelocity<<" spot radius "<<fSpotRadius<<endl;
+  // cout<<"fQThreshold "<<fQThreshold<<" fqmax "<<fQMax<<endl;
+  // signal below threshold should be discarded.
   if (signal->GetCharge() < 0)
-    return (
-      NULL);  //Before type casting signed int into unsigned int need to check for -ve value otherwise after casing -ve int value will become a large +ve value.
+    return (NULL);  // Before type casting signed int into unsigned int need to
+                    // check for -ve value otherwise after casing -ve int value
+                    // will become a large +ve value.
   else if ((unsigned int) signal->GetCharge() < fQThreshold)
     return (NULL);
 
   Long64_t TimeStamp = signal->GetTimeStamp();
   //  Int_t TimeStamp = signal->GetTimeStamp(fQThreshold);
-  //  if (TimeStamp < 0) return (NULL);//entire signal is below threshold, no digi generation.
+  //  if (TimeStamp < 0) return (NULL);//entire signal is below threshold, no
+  //  digi generation.
 
   CbmMuchDigi* digi = new CbmMuchDigi();
   digi->SetAddress(signal->GetAddress());
-  //Charge in number of electrons, need to be converted in ADC value
-  //    digi->SetAdc((signal->GetCharge())*fNADCChannels/fQMax);//Charge should be computed as per Electronics Response.
+  // Charge in number of electrons, need to be converted in ADC value
+  //    digi->SetAdc((signal->GetCharge())*fNADCChannels/fQMax);//Charge should
+  //    be computed as per Electronics Response.
   Float_t adcValue;
   adcValue = ((signal->GetCharge() - fQThreshold) * fNADCChannels) / (fQMax - fQThreshold);
-  digi->SetAdc(adcValue + 1);  //Charge should be computed as per Electronics Response. *** modified by Ekata Nandy***
-  // ADC channels number is 32.GEM & RPC has different charge threshold value and dynamic range, so SetAdc has been changed accordingly. ADC value starts from 1 to 32. ADC 0 has been excluded as it gives wrong x,y,t in Hit finder.@modified by Ekata Nandy
-
-  //  cout<<" dynamic range "<<(fQMax -fQThreshold)<<" adc "<<digi->GetAdc()<<" channels "<<fNADCChannels<< "charge "<<signal->GetCharge()<<endl;
+  digi->SetAdc(adcValue + 1);  // Charge should be computed as per Electronics
+                               // Response. *** modified by Ekata Nandy***
+  // ADC channels number is 32.GEM & RPC has different charge threshold value
+  // and dynamic range, so SetAdc has been changed accordingly. ADC value starts
+  // from 1 to 32. ADC 0 has been excluded as it gives wrong x,y,t in Hit
+  // finder.@modified by Ekata Nandy
+
+  //  cout<<" dynamic range "<<(fQMax -fQThreshold)<<" adc "<<digi->GetAdc()<<"
+  //  channels "<<fNADCChannels<< "charge "<<signal->GetCharge()<<endl;
   /*  if(module->GetDetectorType()==3)
     {hadcGEM->Fill(digi->GetAdc());}
   if(module->GetDetectorType()==4)
@@ -748,7 +786,6 @@ CbmMuchDigi* CbmMuchDigitizeGem::ConvertSignalToDigi(CbmMuchSignal* signal)
   */
   digi->SetTime(TimeStamp);
 
-
   // Update times of first and last digi
   fTimeDigiFirst = fNofDigis ? TMath::Min(fTimeDigiFirst, Double_t(TimeStamp)) : TimeStamp;
   fTimeDigiLast  = TMath::Max(fTimeDigiLast, Double_t(TimeStamp));
@@ -758,12 +795,10 @@ CbmMuchDigi* CbmMuchDigitizeGem::ConvertSignalToDigi(CbmMuchSignal* signal)
   return (digi);
 }
 
-
 // -------------------------------------------------------------------------
 void CbmMuchDigitizeGem::Finish()
 {
 
-
   // --- In event-by-event mode, the analogue buffer should be empty.
   if (fEventMode) {
     if (CbmMuchReadoutBuffer::Instance()->GetNData()) {
@@ -789,7 +824,7 @@ void CbmMuchDigitizeGem::Finish()
     fNofDigisTot += fNofDigis;
     fTimeTot += fTimer.RealTime();
   }  //? time-based mode
-     //noise->Draw();
+     // noise->Draw();
   std::cout << std::endl;
   LOG(info) << "=====================================";
   LOG(info) << GetName() << ": Run summary";
@@ -820,16 +855,15 @@ void CbmMuchDigitizeGem::Finish()
   gFile      = oldFile;
   gDirectory = oldDir;
   */
-  //if (fDaq)	ReadAndRegister(-1.);
+  // if (fDaq)	ReadAndRegister(-1.);
 }
 // -------------------------------------------------------------------------
 
-
 // ------- Private method ExecAdvanced -------------------------------------
 Bool_t CbmMuchDigitizeGem::ExecPoint(const CbmMuchPoint* point, Int_t iPoint)
 {
 
-  //std::cout<<" start execution "<<iPoint<<std::endl;
+  // std::cout<<" start execution "<<iPoint<<std::endl;
   TVector3 v1, v2, dv;
   point->PositionIn(v1);
   point->PositionOut(v2);
@@ -841,7 +875,7 @@ Bool_t CbmMuchDigitizeGem::ExecPoint(const CbmMuchPoint* point, Int_t iPoint)
   DetectorParameters(module);
 
   int detectortype = module->GetDetectorType();
-  //cout<<" dec type === "<<detectortype<<endl;
+  // cout<<" dec type === "<<detectortype<<endl;
   if (fAlgorithm == 0) {  // Simple digitization
     TVector3 v      = 0.5 * (v1 + v2);
     CbmMuchPad* pad = 0;
@@ -862,7 +896,7 @@ Bool_t CbmMuchDigitizeGem::ExecPoint(const CbmMuchPoint* point, Int_t iPoint)
   // Start of advanced digitization
   Int_t nElectrons = Int_t(GetNPrimaryElectronsPerCm(point, detectortype) * dv.Mag());
   if (nElectrons < 0) return kFALSE;
-  //cout<<" nElectrons "<<nElectrons<<endl;
+  // cout<<" nElectrons "<<nElectrons<<endl;
   /*
 if(detectortype==3)
 {//cout<<" nElectrons "<<nElectrons<<endl;
@@ -925,42 +959,45 @@ hPriElAfterDriftpathrpc->Fill(nElectrons);}
       LOG(debug) << GetName() << ": Not Processing MCPoint " << iPoint << " because it is not on any GEM module.";
       return 1;
     }
-    CbmMuchSectorRadial* sFirst = (CbmMuchSectorRadial*) module3->GetSectorByIndex(0);  //First sector
+    CbmMuchSectorRadial* sFirst = (CbmMuchSectorRadial*) module3->GetSectorByIndex(0);  // First sector
     if (!sFirst) {
       LOG(debug) << GetName() << ": Not Processing MCPoint " << iPoint << " because it is on the module " << module3
                  << "  but not the first sector. " << sFirst;
       return 1;
     }
     CbmMuchSectorRadial* sLast =
-      (CbmMuchSectorRadial*) module3->GetSectorByIndex(module3->GetNSectors() - 1);  //Last sector
+      (CbmMuchSectorRadial*) module3->GetSectorByIndex(module3->GetNSectors() - 1);  // Last sector
 
     if (!sLast) {
       LOG(debug) << GetName() << ": Not Processing MCPoint " << iPoint
                  << " because it is not the last sector of module." << module3;
       return 1;
     }
-    Double_t rMin = sFirst->GetR1();  //Mimimum radius of the Sector//5
-    Double_t rMax = sLast->GetR2();   //Maximum radius of the Sector//35
+    Double_t rMin = sFirst->GetR1();  // Mimimum radius of the Sector//5
+    Double_t rMax = sLast->GetR2();   // Maximum radius of the Sector//35
 
-    //cout<<rMin<<"      Yeah      "<<rMax<<endl;
+    // cout<<rMin<<"      Yeah      "<<rMax<<endl;
     // std::cout<<"min Rad "<<rMin<<"   max Rad  "<<rMax<<std::endl;
-    //Calculating drifttime once for one track or one MCPoint, not for all the Primary Electrons generated during DriftGap.
+    // Calculating drifttime once for one track or one MCPoint, not for all the
+    // Primary Electrons generated during DriftGap.
 
     Double_t driftTime = -1;
     while (driftTime < 0) {
 
-      Double_t aL = gRandom->Gaus(0.5, 0.133);  //Generting random number for calculating Drift Time.
-      // cout<<"Det Type "<<detectortype<<"fTotalDriftTime "<<fTotalDriftTime<<endl;
+      Double_t aL = gRandom->Gaus(0.5, 0.133);  // Generting random number for calculating Drift Time.
+      // cout<<"Det Type "<<detectortype<<"fTotalDriftTime
+      // "<<fTotalDriftTime<<endl;
       driftTime = (1 - aL) * fTotalDriftTime;
     }
 
-    for (Int_t i = 0; i < nElectrons; i++) {  //Looping over all the primary electrons
+    for (Int_t i = 0; i < nElectrons; i++) {  // Looping over all the primary electrons
       Double_t RandomNumberForPrimaryElectronPosition = gRandom->Rndm();
       TVector3 ve                                     = v1 + dv * RandomNumberForPrimaryElectronPosition;
 
-      //------------------------Added by O. Singh 11.12.2017 for mCbm-------------------------
+      //------------------------Added by O. Singh 11.12.2017 for
+      // mCbm-------------------------
       Double_t r = 0.0, phi = 0.0;
-      if (fFlag == 1) {  //mCbm
+      if (fFlag == 1) {                      // mCbm
         if (module->GetDetectorType() == 3)  // GEM
         {
           ve.SetX(ve.X() - fGemTX);
@@ -978,20 +1015,20 @@ hPriElAfterDriftpathrpc->Fill(nElectrons);}
       r   = ve.Perp();
       phi = ve.Phi();
       //--------------------------------------------------------------------------
-      UInt_t ne     = GasGain();  //Number of secondary electrons
+      UInt_t ne     = GasGain();  // Number of secondary electrons
       Double_t r1   = r - fSpotRadius;
       Double_t r2   = r + fSpotRadius;
       Double_t phi1 = phi - fSpotRadius / r;
       Double_t phi2 = phi + fSpotRadius / r;
       // cout<<" fSpotRadius "<<fSpotRadius<<endl;
-      if (r1 < rMin && r2 > rMin) {  //Adding charge to the pad which is on Lower Boundary
+      if (r1 < rMin && r2 > rMin) {  // Adding charge to the pad which is on Lower Boundary
         Status = AddCharge(sFirst, UInt_t(ne * (r2 - rMin) / (r2 - r1)), iPoint, time, driftTime, phi1, phi2);
         if (!Status)
           LOG(debug) << GetName() << ": Processing MCPoint " << iPoint << " in which Primary Electron : " << i
                      << " not contributed charge. ";
         continue;
       }
-      if (r1 < rMax && r2 > rMax) {  //Adding charge to the pad which is on Upper Boundary
+      if (r1 < rMax && r2 > rMax) {  // Adding charge to the pad which is on Upper Boundary
         Status = AddCharge(sLast, UInt_t(ne * (rMax - r1) / (r2 - r1)), iPoint, time, driftTime, phi1, phi2);
         if (!Status)
           LOG(debug) << GetName() << ": Processing MCPoint " << iPoint << " in which Primary Electron : " << i
@@ -1004,14 +1041,13 @@ hPriElAfterDriftpathrpc->Fill(nElectrons);}
       CbmMuchSectorRadial* s1 = module3->GetSectorByRadius(r1);
       CbmMuchSectorRadial* s2 = module3->GetSectorByRadius(r2);
 
-
       if (s1 == s2) {
         Status = AddCharge(s1, ne, iPoint, time, driftTime, phi1, phi2);
         if (!Status)
           LOG(debug3) << GetName() << ": Processing MCPoint " << iPoint << " in which Primary Electron : " << i
                       << " not contributed charge. ";
       }
-      else {  //Adding praportionate charge to both the pad
+      else {  // Adding praportionate charge to both the pad
         Status = AddCharge(s1, UInt_t(ne * (s1->GetR2() - r1) / (r2 - r1)), iPoint, time, driftTime, phi1, phi2);
         if (!Status)
           LOG(debug3) << GetName() << ": Processing MCPoint " << iPoint << " in which Primary Electron : " << i
@@ -1023,7 +1059,8 @@ hPriElAfterDriftpathrpc->Fill(nElectrons);}
       }
     }
 
-    //Generate CbmMuchSignal for each entry of fAddressCharge and store in the CbmMuchReadoutBuffer
+    // Generate CbmMuchSignal for each entry of fAddressCharge and store in the
+    // CbmMuchReadoutBuffer
     if (!BufferSignals(iPoint, time, driftTime))
       LOG(debug3) << GetName() << ": Processing MCPoint " << iPoint << " nothing is buffered. ";
     fAddressCharge.clear();
@@ -1037,7 +1074,7 @@ hPriElAfterDriftpathrpc->Fill(nElectrons);}
 // -------------------------------------------------------------------------
 Int_t CbmMuchDigitizeGem::GasGain()
 {
-  //cout<<" mean gain "<<fMeanGasGain<<endl;
+  // cout<<" mean gain "<<fMeanGasGain<<endl;
   Double_t gasGain = -fMeanGasGain * TMath::Log(1 - gRandom->Rndm());
   if (gasGain < 0.) gasGain = 1e6;
   return (Int_t) gasGain;
@@ -1094,7 +1131,6 @@ Double_t CbmMuchDigitizeGem::MPV_n_e(Double_t Tkin, Double_t mass)
 }
 // -------------------------------------------------------------------------
 
-
 // -------------------------------------------------------------------------
 Double_t CbmMuchDigitizeGem::GetNPrimaryElectronsPerCm(const CbmMuchPoint* point, int detectortype)
 {
@@ -1102,7 +1138,8 @@ Double_t CbmMuchDigitizeGem::GetNPrimaryElectronsPerCm(const CbmMuchPoint* point
   //  Int_t eventId = point->GetEventID();
   if (trackId < 0) return -1;
   /* Commented out on request of A. Senger from 22.01.2014
-     if (fDaq && eventId!=FairRootManager::Instance()->GetInTree()->GetBranch("MCTrack")->GetReadEntry())
+     if (fDaq &&
+     eventId!=FairRootManager::Instance()->GetInTree()->GetBranch("MCTrack")->GetReadEntry())
      FairRootManager::Instance()->GetInTree()->GetBranch("MCTrack")->GetEntry(eventId);
   */
   CbmMCTrack* mcTrack = (CbmMCTrack*) fMCTracks->At(trackId);
@@ -1122,10 +1159,10 @@ Double_t CbmMuchDigitizeGem::GetNPrimaryElectronsPerCm(const CbmMuchPoint* point
   Double_t sigma = CbmMuchDigitizeGem::Sigma_n_e(Tkin, m);  // sigma for Landau distribution
   Double_t mpv   = CbmMuchDigitizeGem::MPV_n_e(Tkin, m);    // most probable value for Landau distr.
   Double_t n;
-  Double_t mpvRpc =
-    50.0;  // For RPC MPV and sigma is taken to produce final landau in accordance with experimental value
+  Double_t mpvRpc = 50.0;  // For RPC MPV and sigma is taken to produce final
+                           // landau in accordance with experimental value
   Double_t sigmaRpc = 12.0;
-  //cout<<" dec type function "<<detectortype<<endl;
+  // cout<<" dec type function "<<detectortype<<endl;
   if (detectortype == 3)  /// GEM
   {
     n = gRandom->Landau(mpv, sigma);
@@ -1145,50 +1182,43 @@ Double_t CbmMuchDigitizeGem::GetNPrimaryElectronsPerCm(const CbmMuchPoint* point
 }
 // -------------------------------------------------------------------------
 // -------------------------------------------------------------------------
-Bool_t CbmMuchDigitizeGem::AddCharge(CbmMuchSectorRadial *s, UInt_t ne,
-                                     Int_t /*iPoint*/, Double_t /*time*/,
-                                     Double_t /*driftTime*/, Double_t phi1,
-                                     Double_t phi2) {
-  CbmMuchPadRadial *pad1 = s->GetPadByPhi(phi1);
+Bool_t CbmMuchDigitizeGem::AddCharge(CbmMuchSectorRadial* s, UInt_t ne, Int_t /*iPoint*/, Double_t /*time*/,
+                                     Double_t /*driftTime*/, Double_t phi1, Double_t phi2)
+{
+  CbmMuchPadRadial* pad1 = s->GetPadByPhi(phi1);
   if (!pad1)
-    pad1 = s->GetPadByPhi(
-        (phi1 + phi2) / 2.0); // This condition helps us deal with boundary pads
-  else // Special case if pad size is smaller than spot radius
+    pad1 = s->GetPadByPhi((phi1 + phi2) / 2.0);  // This condition helps us deal with boundary pads
+  else                                           // Special case if pad size is smaller than spot radius
   {
-    for (Double_t phi = phi1; phi < (phi1 + phi2) / 2.0;
-         phi += 0.1) // This may potentially slow down the code
+    for (Double_t phi = phi1; phi < (phi1 + phi2) / 2.0; phi += 0.1)  // This may potentially slow down the code
     {
       pad1 = s->GetPadByPhi(phi);
-      if (pad1)
-        break;
+      if (pad1) break;
     }
   }
-  if (!pad1)
-    return kFALSE;
+  if (!pad1) return kFALSE;
   // assert(pad1); has to check if any pad address is NULL
-  CbmMuchPadRadial *pad2 = s->GetPadByPhi(phi2);
+  CbmMuchPadRadial* pad2 = s->GetPadByPhi(phi2);
   if (!pad2)
-    pad2 = s->GetPadByPhi(
-        (phi1 + phi2) / 2.0); // This condition helps us deal with boundary pads
-  else // Special case if pad size is smaller than spot radius
+    pad2 = s->GetPadByPhi((phi1 + phi2) / 2.0);  // This condition helps us deal with boundary pads
+  else                                           // Special case if pad size is smaller than spot radius
   {
-    for (Double_t phi = phi2; phi > (phi1 + phi2) / 2.0;
-         phi -= 0.1) // This may potentially slow down the code
+    for (Double_t phi = phi2; phi > (phi1 + phi2) / 2.0; phi -= 0.1)  // This may potentially slow down the code
     {
       pad2 = s->GetPadByPhi(phi);
-      if (pad2)
-        break;
+      if (pad2) break;
     }
   }
 
-  if (!pad2)
-    return kFALSE;
+  if (!pad2) return kFALSE;
   // assert(pad2); has to check if any pad address is NULL
   if (pad1 == pad2) {
     UInt_t address = pad1->GetAddress();
-    //Finding that if for the same address if already charge stored then add the charge.
+    // Finding that if for the same address if already charge stored then add
+    // the charge.
     std::map<UInt_t, UInt_t>::iterator it = fAddressCharge.find(address);
-    if (it != fAddressCharge.end()) it->second = it->second + ne;
+    if (it != fAddressCharge.end())
+      it->second = it->second + ne;
     else
       fAddressCharge.insert(std::pair<UInt_t, UInt_t>(address, ne));
     //    AddChargePerMC(pad1,ne,iPoint,time,driftTime);
@@ -1198,19 +1228,22 @@ Bool_t CbmMuchDigitizeGem::AddCharge(CbmMuchSectorRadial *s, UInt_t ne,
     UInt_t pad1_ne = UInt_t(ne * (phi - phi1) / (phi2 - phi1));
 
     UInt_t address = pad1->GetAddress();
-    //Finding that if for the same address if already charge stored then add the charge.
+    // Finding that if for the same address if already charge stored then add
+    // the charge.
     std::map<UInt_t, UInt_t>::iterator it = fAddressCharge.find(address);
-    if (it != fAddressCharge.end()) it->second = it->second + pad1_ne;
+    if (it != fAddressCharge.end())
+      it->second = it->second + pad1_ne;
     else
       fAddressCharge.insert(std::pair<UInt_t, UInt_t>(address, pad1_ne));
     //    AddChargePerMC(pad1,pad1_ne   ,iPoint,time,driftTime);
 
-
     // Getting some segmentation fault a
     address = pad2->GetAddress();
-    //Finding that if for the same address if already charge stored then add the charge.
+    // Finding that if for the same address if already charge stored then add
+    // the charge.
     it = fAddressCharge.find(address);
-    if (it != fAddressCharge.end()) it->second = it->second + ne - pad1_ne;
+    if (it != fAddressCharge.end())
+      it->second = it->second + ne - pad1_ne;
     else
       fAddressCharge.insert(std::pair<UInt_t, UInt_t>(address, ne - pad1_ne));
     // AddChargePerMC(pad2,ne-pad1_ne,iPoint,time,driftTime);
@@ -1219,36 +1252,34 @@ Bool_t CbmMuchDigitizeGem::AddCharge(CbmMuchSectorRadial *s, UInt_t ne,
 }
 // -------------------------------------------------------------------------
 
-
 // -------------------------------------------------------------------------
-//Will remove this AddCharge, only used for simple and Rectangular Geometry.
+// Will remove this AddCharge, only used for simple and Rectangular Geometry.
 void CbmMuchDigitizeGem::AddCharge(CbmMuchPad* pad, UInt_t charge, Int_t iPoint, Double_t time, Double_t driftTime)
 {
   if (!pad) return;
 
   Long_t AbsTime = fCurrentEventTime + time + driftTime;
 
-  //Creating a new Signal, it will be deleted by CbmReadoutBuffer()
+  // Creating a new Signal, it will be deleted by CbmReadoutBuffer()
   CbmMuchSignal* signal = new CbmMuchSignal(pad->GetAddress(), AbsTime);
-  //signal->SetTimeStart(AbsTime);
-  //signal->SetTimeStop(AbsTime+fDeadTime);
+  // signal->SetTimeStart(AbsTime);
+  // signal->SetTimeStop(AbsTime+fDeadTime);
   signal->SetCharge(charge);
-  //signal->MakeSignalShape(charge,fgDeltaResponse);
+  // signal->MakeSignalShape(charge,fgDeltaResponse);
   signal->AddNoise(fMeanNoise);
   UInt_t address = pad->GetAddress();
-  //match->AddCharge(iPoint,charge,time+driftTime,fgDeltaResponse,time,eventNr,inputNr);
+  // match->AddCharge(iPoint,charge,time+driftTime,fgDeltaResponse,time,eventNr,inputNr);
   CbmLink link(charge, iPoint, fCurrentMCEntry, fCurrentInput);
-  //std::cout<<"Before AddLink"<< endl;
+  // std::cout<<"Before AddLink"<< endl;
   (signal->GetMatch())->AddLink(link);
-  //std::cout<<"After AddLink"<< endl;
-  //Adding all these temporary signal into the CbmMuchReadoutBuffer
+  // std::cout<<"After AddLink"<< endl;
+  // Adding all these temporary signal into the CbmMuchReadoutBuffer
   CbmMuchReadoutBuffer::Instance()->Fill(address, signal);
-  //Increasing number of signal by one.
+  // Increasing number of signal by one.
   fNofSignals++;
   LOG(debug4) << " Registered the CbmMuchSignal into the CbmMuchReadoutBuffer ";
 
-}  //end of AddCharge
-
+}  // end of AddCharge
 
 //----------------------------------------------------------
 Bool_t CbmMuchDigitizeGem::BufferSignals(Int_t iPoint, Double_t time, Double_t driftTime)
@@ -1263,22 +1294,23 @@ Bool_t CbmMuchDigitizeGem::BufferSignals(Int_t iPoint, Double_t time, Double_t d
   LOG(debug2) << GetName() << ": Processing event " << fCurrentEvent << " from input " << fCurrentInput
               << " at t = " << fCurrentEventTime << " ns with " << fPoints->GetEntriesFast() << " MuchPoints "
               << " and Number of pad hit is " << fAddressCharge.size() << ".";
-  //Loop on the fAddressCharge to store all the Signals into the CbmReadoutBuffer()
-  //Generate one by one CbmMuchSignal from the fAddressCharge and store them into the CbmMuchReadoutBuffer.
+  // Loop on the fAddressCharge to store all the Signals into the
+  // CbmReadoutBuffer() Generate one by one CbmMuchSignal from the
+  // fAddressCharge and store them into the CbmMuchReadoutBuffer.
   for (auto it = fAddressCharge.begin(); it != fAddressCharge.end(); ++it) {
     UInt_t address = it->first;
-    //Creating a new Signal, it will be deleted by CbmReadoutBuffer()
+    // Creating a new Signal, it will be deleted by CbmReadoutBuffer()
     CbmMuchSignal* signal = new CbmMuchSignal(address, AbsTime);
-    //signal->SetTimeStart(AbsTime);
-    //signal->SetTimeStop(AbsTime+fDeadTime);
-    //signal->MakeSignalShape(it->second,fgDeltaResponse);
+    // signal->SetTimeStart(AbsTime);
+    // signal->SetTimeStop(AbsTime+fDeadTime);
+    // signal->MakeSignalShape(it->second,fgDeltaResponse);
     signal->SetCharge(it->second);
     signal->AddNoise(fMeanNoise);
     CbmLink link(signal->GetCharge(), iPoint, fCurrentMCEntry, fCurrentInput);
     (signal->GetMatch())->AddLink(link);
-    //Adding all these temporary signal into the CbmMuchReadoutBuffer
+    // Adding all these temporary signal into the CbmMuchReadoutBuffer
     CbmMuchReadoutBuffer::Instance()->Fill(address, signal);
-    //Increasing number of signal by one.
+    // Increasing number of signal by one.
     fNofSignals++;
     LOG(debug3) << " Registered the CbmMuchSignal into the CbmMuchReadoutBuffer ";
   }
@@ -1286,8 +1318,7 @@ Bool_t CbmMuchDigitizeGem::BufferSignals(Int_t iPoint, Double_t time, Double_t d
   LOG(debug2) << GetName() << ": For MC Point " << iPoint << " buffered " << fAddressCharge.size()
               << " CbmMuchSignal into the CbmReadoutBuffer.";
   return kTRUE;
-}  //end of BufferSignals
+}  // end of BufferSignals
 // -------------------------------------------------------------------------
 
-
 ClassImp(CbmMuchDigitizeGem)
-- 
GitLab