Skip to content
Snippets Groups Projects
Commit 8a544af7 authored by Stephen A. Wood's avatar Stephen A. Wood Committed by Gabriel Niculescu
Browse files

Pass a start time computed in THcHodoscope to THcDriftChamberPlane. A dummy...

Pass a start time computed in THcHodoscope to THcDriftChamberPlane. A dummy value for the start time is used until the Hodoscope code actually computes the start time.
parent 08fdc0a3
No related branches found
No related tags found
No related merge requests found
......@@ -15,6 +15,7 @@
#include "THcParmList.h"
#include "THcHitList.h"
#include "THcDriftChamber.h"
#include "THcHodoscope.h"
#include "TClass.h"
#include <cstring>
......@@ -115,6 +116,14 @@ Int_t THcDriftChamberPlane::ReadDatabase( const TDatime& date )
//if( something < 0 ) wire->SetFlag(1);
}
THaApparatus* app = GetApparatus();
const char* nm = "hod";
if( !app ||
!(fglHod = dynamic_cast<THcHodoscope*>(app->GetDetector(nm))) ) {
Warning(Here(here),"Hodoscope \"%s\" not found. "
"Event-by-event time offsets will NOT be used!!",nm);
}
return kOK;
}
//_____________________________________________________________________________
......@@ -175,6 +184,12 @@ Int_t THcDriftChamberPlane::ProcessHits(TClonesArray* rawhits, Int_t nexthit)
// Assumes that the hit list is sorted by plane, so we stop when the
// plane doesn't agree and return the index for the next hit.
Double_t StartTime = 0.0;
// Would be nice to have a way to determine that the hodoscope decode was
// actually called for this event.
if( fglHod ) StartTime = fglHod->GetStartTime();
cout << "Start time " << StartTime << endl;
//Int_t nTDCHits=0;
fHits->Clear();
......@@ -206,7 +221,7 @@ Int_t THcDriftChamberPlane::ProcessHits(TClonesArray* rawhits, Int_t nexthit)
// Are we choose the same hit that ENGINE chooses?
// cout << "Extra hit " << fPlaneNum << " " << wireNum << " " << rawtdc << endl;
} else {
Double_t time = // -hstart_time (comes from h_trans_scin
Double_t time = -StartTime // (comes from h_trans_scin
- rawtdc*fNSperChan + fPlaneTimeZero;
// How do we get this start time from the hodoscope to here
// (or at least have it ready by coarse process)
......
......@@ -20,6 +20,7 @@ class THaEvData;
class THcDCWire;
class THcDCHit;
class THcDCTimeToDistConv;
class THcHodoscope;
/*class THaSignalHit;*/
......@@ -73,6 +74,8 @@ class THcDriftChamberPlane : public THaSubDetector {
THcDCTimeToDistConv* fTTDConv; // Time-to-distance converter for this plane's wires
THcHodoscope* fglHod; // Hodoscope to get start time
ClassDef(THcDriftChamberPlane,0)
};
#endif
......
......@@ -575,6 +575,8 @@ Int_t THcHodoscope::Decode( const THaEvData& evdata )
cout << endl;
#endif
fStartTime = 500; // Drift Chamber will need this
return nhits;
}
......
......@@ -32,6 +32,7 @@ public:
virtual Int_t ApplyCorrections( void );
// Int_t GetNHits() const { return fNhit; }
Double_t GetStartTime() const { return fStartTime; }
Int_t GetScinIndex(Int_t nPlane, Int_t nPaddle);
Int_t GetScinIndex(Int_t nSide, Int_t nPlane, Int_t nPaddle);
Double_t GetPathLengthCentral();
......@@ -50,7 +51,8 @@ protected:
// Per-event data
Double_t fStartTime;
// Potential Hall C parameters. Mostly here for demonstration
Int_t fNPlanes,fMaxScinPerPlane,fMaxHodoScin; // number of planes; max number of scin/plane; product of the first two
Double_t fStartTimeCenter, fStartTimeSlop, fScinTdcToTime;
......
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