Skip to content
Snippets Groups Projects
Commit a4186aeb authored by hallc-online's avatar hallc-online
Browse files

Modified THcDriftChamberPlane.cxx and THcDriftChamberPlane.h

Main purpose was to have option for per wire tzero offsets

Modified THcDriftChamberPlane.h
------------------------------
1) added fUsingTzeroPerWire as parameter flag to switch on per wire tzero offsets when parameter equals 1
2) fTzeroWire is array of tzero offsets for each wire in plane

Modified THcDriftChamberPlane.cxx
------------------------------
1) THcDriftChamberPlane::ReadDatabase
    a)set a default value of fUsingTzeroPerWire=0
    b)added to DBRequest list option to read in fUsingTzeroPerWire
    c) if fUsingTzeroPerWire=1 then separate DBRequest to read in fTzeroWire
   d) if fUsingTzeroPerWire=0 then all fTzeroWire=0

2) THcDriftChamberPlane::ProcessHits
------------------------------------
   a) Modify calcualation of drift time to subtract fTzeroWire
Double_t time = -StartTime- rawtdc*fNSperChan + fPlaneTimeZero - fTzeroWire[wireNum-1];
parent 5abda424
No related branches found
No related tags found
No related merge requests found
......@@ -92,13 +92,14 @@ Int_t THcDriftChamberPlane::ReadDatabase( const TDatime& date )
UInt_t NumDriftMapBins;
Double_t DriftMapFirstBin;
Double_t DriftMapBinSize;
fUsingTzeroPerWire=0;
prefix[0]=tolower(GetParent()->GetPrefix()[0]);
prefix[1]='\0';
DBRequest list[]={
{"driftbins", &NumDriftMapBins, kInt},
{"drift1stbin", &DriftMapFirstBin, kDouble},
{"driftbinsz", &DriftMapBinSize, kDouble},
{"_using_tzero_per_wire", &fUsingTzeroPerWire, kInt,0,1},
{0}
};
gHcParms->LoadParmValues((DBRequest*)&list,prefix);
......@@ -110,6 +111,7 @@ Int_t THcDriftChamberPlane::ReadDatabase( const TDatime& date )
};
gHcParms->LoadParmValues((DBRequest*)&list2,prefix);
// Retrieve parameters we need from parent class
THcDC* fParent;
......@@ -130,6 +132,25 @@ Int_t THcDriftChamberPlane::ReadDatabase( const TDatime& date )
fNSperChan = fParent->GetNSperChan();
if (fUsingTzeroPerWire==1) {
fTzeroWire = new Double_t [fNWires];
DBRequest list3[]={
{Form("tzero%s",GetName()),fTzeroWire,kDouble,fNWires},
{0}
};
gHcParms->LoadParmValues((DBRequest*)&list3,prefix);
printf(" using tzero per wire plane = %s nwires = %d \n",GetName(),fNWires);
for (Int_t iw=0;iw < fNWires;iw++) {
printf("%d %f ",iw+1,fTzeroWire[iw]) ;
if ( iw!=0 && iw%8 == 0) printf("\n") ;
}
} else {
fTzeroWire = new Double_t [fNWires];
for (Int_t iw=0;iw < fNWires;iw++) {
fTzeroWire[iw]=0.0;
}
}
// Calculate Geometry Constants
// Do we want to move all this to the Chamber of DC Package leve
// as that is where these things will be needed?
......@@ -322,7 +343,8 @@ Int_t THcDriftChamberPlane::ProcessHits(TClonesArray* rawhits, Int_t nexthit)
// Increment late count
} else {
Double_t time = -StartTime // (comes from h_trans_scin
- rawtdc*fNSperChan + fPlaneTimeZero; // fNSperChan > 0 for 1877
- rawtdc*fNSperChan + fPlaneTimeZero - fTzeroWire[wireNum-1]; // fNSperChan > 0 for 1877
// (cout << " Plane = " << GetName() << " wire = " << wireNum << " " << fPlaneTimeZero << " " << fTzeroWire[wireNum-1] << endl;
// < 0 for Caen1190.
// - (rawtdc-reftime)*fNSperChan + fPlaneTimeZero;
// How do we get this start time from the hodoscope to here
......
......@@ -79,6 +79,7 @@ protected:
Int_t fPlaneNum;
Int_t fPlaneIndex; /* Index of this plane within it's chamber */
Int_t fChamberNum;
Int_t fUsingTzeroPerWire;
Int_t fNRawhits;
Int_t fNWires;
Int_t fWireOrder;
......@@ -104,6 +105,8 @@ protected:
Double_t fNSperChan; /* TDC bin size */
Double_t* fTzeroWire;
virtual Int_t ReadDatabase( const TDatime& date );
virtual Int_t DefineVariables( EMode mode = kDefine );
......
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