Skip to content
Snippets Groups Projects
Commit 73338e25 authored by Vikas Singhal's avatar Vikas Singhal
Browse files

Modified MuchSignal according GEM and RPC

parent 28a68d9b
Branches RPC_deadtime
No related tags found
No related merge requests found
......@@ -59,7 +59,8 @@ CbmMuchSignal::CbmMuchSignal(const CbmMuchSignal& rhs)
,
//fModifiedCharge(rhs.fModifiedCharge),
fPileUpCount(rhs.fPileUpCount)
,
, fDeadTime(rhs.fDeadTime)
, fDetectorType(rhs.fDetectorType)
//fSignalShape(rhs.fSignalShape),
fMatch(rhs.fMatch)
{
......@@ -93,8 +94,12 @@ CbmMuchSignal& CbmMuchSignal::operator=(const CbmMuchSignal& rhs)
//
// -------------------------------------------------------------------------
//Below function will add the Signal shapes of 2 signal
// MergeSignal changing according to the detectortype
// if(detectortype == 3) // GEM Merge Charge and increase deadtime.
// if(detectortype == 4) // RPC new signal will be lost. no increase in deadtime.
//
void CbmMuchSignal::MergeSignal(CbmMuchSignal* signal)
void CbmMuchSignal::MergeSignal(CbmMuchSignal* signal, Int_t detectortype)
{
fPileUpCount++;
fPileUpCount += signal->GetPileUpCount();
......@@ -104,9 +109,9 @@ void CbmMuchSignal::MergeSignal(CbmMuchSignal* signal)
Long_t PileUpTime = 0;
LOG(debug4) << " Start Difference " << StartDiff << " Stop Difference " << StopDiff;
if (StopDiff > 0)
fTimeStop =
signal
->GetTimeStop(); //Shows Second signal Stop time is larger than first signal stop time, therefore fStopTime modified.
if (detectortype == 3)
fTimeStop = signal->GetTimeStop();
//Shows Second signal Stop time is larger than first signal stop time, therefore fStopTime modified only for GEM. For RPC second signal will be lost so no effect on first signal.
if (StartDiff < 0) {
//Shows that New Signal is earlier than This signal.
// std::cout<<"First Signal start time " <<fTimeStart<<" Second Signal start time is " <<signal->GetTimeStart() << endl;
......@@ -120,7 +125,10 @@ void CbmMuchSignal::MergeSignal(CbmMuchSignal* signal)
}
Long_t PileUpDiff = PileUpTime - fTimeStart;
if (PileUpDiff < 0) { LOG(info) << GetName() << " Problem: Check this particular pile up case."; }
if (PileUpDiff < SLOWSHAPERPEAK) { fCharge += signal->GetCharge(); }
// Adding charge value only for GEM. For RPC no change in the charge.
if (detectortype == 3 )
if (PileUpDiff < SLOWSHAPERPEAK) { fCharge += signal->GetCharge(); }
else if (!MeFirst)
fCharge = signal->GetCharge();
......
......@@ -3,6 +3,9 @@
Authors: Vikas Singhal [committer] */
/**CbmMuchSignal.h
* @author Vikas Singhal <vikas@vecc.gov.in> and Ekata Nandy
**@since 22/10/21
**@version 3.0
* @author Vikas Singhal <vikas@vecc.gov.in>
**@since 10/04/18
**@version 2.0
......@@ -31,12 +34,13 @@
class TClonesArray;
//static const Int_t gkResponseBin = 1;
static const Int_t fDeadTime = 400; // Deadtime
// Deadtime will be a parameter which is provided from Digitizer. It is different for GEM and RPC.
// static const Int_t fDeadTime = 400; // Deadtime
class CbmMuchSignal : public TObject {
public:
/** Default Constructor */
CbmMuchSignal() : TObject(), fAddress(0), fTimeStart(0), fTimeStop(0), fCharge(0), fPileUpCount(0), fMatch(nullptr) {}
CbmMuchSignal() : TObject(), fAddress(0), fTimeStart(0), fTimeStop(0), fCharge(0), fPileUpCount(0), fDeadTime(0), fDetectorType(0), fMatch(nullptr) {}
//CbmMuchSignal(): TObject(), fAddress(0), fTimeStart(0), fTimeStop(0), fCharge(0), fPileUpTime(0), fModifiedCharge(0), fPileUpCount(0),fMatch(nullptr) {}
//WithSignalShape CbmMuchSignal(): TObject(), fAddress(0), fTimeStart(0), fTimeStop(0), fSignalShape(0), fMatch(nullptr) {}
......@@ -47,13 +51,15 @@ public:
** @param fModifiedCharge Charge after PileUp and checks whetherslowshaper crossed 70-80ns time window. If yes then no change and fCharge will be used. If no then charge will be calculated as per slowshaper behavior of XYTER
**
**/
CbmMuchSignal(UInt_t address, Long64_t starttime = 0)
CbmMuchSignal(UInt_t address, Long64_t starttime = 0, UInt_t deadtime = 400, Int_t detector_type = 3)
: TObject()
, fAddress(address)
, fTimeStart(starttime)
, fDeadTime(deadtime)
, fTimeStop(fTimeStart + fDeadTime)
, fCharge(0)
, fPileUpCount(0)
, fDetectorType(detector_type)
, fMatch(new CbmMatch())
{
}
......@@ -95,6 +101,8 @@ public:
//TArrayD GetSignalShape() const {return fSignalShape; }
CbmMatch* GetMatch() const { return fMatch; }
Int_t GetAddress() const { return fAddress; }
UInt_t GetDeadTime() const { return fDeadTime; }
Int_t GetDetectorType() const { return fDetectorType; }
//Setters
void SetTimeStart(Long_t starttime) { fTimeStart = starttime; }
......@@ -108,7 +116,7 @@ public:
//void MakeSignalShape(UInt_t,TArrayD);
//MergeSignal Function which will implement Signal PileUp
void MergeSignal(CbmMuchSignal*);
void MergeSignal(CbmMuchSignal*, Int_t);
void AddNoise(UInt_t);
//Int_t GetMaxCharge();
......@@ -125,8 +133,11 @@ private:
UInt_t fPileUpCount = 0; //Count for PileUp cases
// TArrayD fSignalShape; // Array of time bins
//Making Actual Electronics Signal Shape
UInt_t fDeadTime = 400; // default 400 ns for GEM.
Int_t fDetectorType = 3; // default 3 for GEM.
CbmMatch* fMatch;
ClassDef(CbmMuchSignal, 2);
ClassDef(CbmMuchSignal, 3);
};
#endif
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment