#include "TClasTool.h" |
virtual void | TObject::DoError(int level, const char* location, const char* fmt, va_list va) const |
void | TObject::MakeZombie() |
TVERTClass* | Vert_Error_Handler(Int_t NRows, Int_t track1, Int_t track2) |
enum TObject::EStatusBits { | kCanDelete | |
kMustCleanup | ||
kObjInCanvas | ||
kIsReferenced | ||
kHasUUID | ||
kCannotPick | ||
kNoContextMenu | ||
kInvalidObject | ||
}; | ||
enum TObject::[unnamed] { | kIsOnHeap | |
kNotDeleted | ||
kZombie | ||
kBitMask | ||
kSingleKey | ||
kOverwrite | ||
kWriteDelete | ||
}; |
TVirtualReader* | fReader | This is a pointer to the actual reader used. |
Int_t | fDebug_Mode | Sets the verbosity of the code. |
____________________
Created at UNH by Maurik Holtrop and Gagik Gavalian
This class provides a flexible way to analyze CLAS data using the ROOT system. It was originally intended to read ROOT based DST files created by the WriteRootDST utility, but has since then been expanded to handle other data formats as well. See the TNT10Reader class for a reader of ntuple-10 hbook files.
The penalty is an additional layer of classes, and the overhead (very slight) in passing calls from one layer to the underlying layer.
Note that in general this framework is not build to be the fastest code with the smallest DST. The idea is to have something that is reliable, understandable and comprehensive.
The TClasTool class acts as an interface to the data through a DST reader class.
You start by connecting to a
I hope that eventually this class can be expanded to also connect to a TFiducialCut class to provide CLAS fiducial cuts, a TMomentumCorrection class to provide momentum corrections and perhaps even particle id corrections, kinematic fitting any other common tasks that form a complete analysis.
Additional information about this package, including an overview, can be found at the ClasTool Documentation web pages.
Initialize the DST reader if not already defined. Argument can be: ROOTDSTR -- start a TDSTReader [default]
Set the current DST reader to reader. Argument can be any DST class derived from TVirtualReader Example: TClasTool *ct=new TClasTool(); TNT10Reader *nt=new TNT10Reader(); ct->InitDSTReader(nt); ct->Add("myfile.hbook"); ....
Add one or more files to the chain of files to be analyzed, using wildcard format. This filename is passed on to the DST reader that is currently initialized.
Add a single file to the chain of files to be analyzed. This filename is passed on to the DST reader that is currently initialized.
Add a single file to the EPIC chain of files. Files must be added in order of run number for GetEPICValue to work correctly. Only for use with TDSTReader
Return the bank with bankname (i.e. "EVNT") at row nrow.
Return the number of events (entries) in all files, without checking. This is faster, but could return the wrong number is GetEntries() was not called earlier.
Get a specific entry from the file with sequence number entry.
Return a pointer to the current EPIC bank. Returns the current EPIC without checking to see if it corresponds to the current physics event. Calling GETEPICValue first will ensure the EPIC bank corresponds to the physics bank.
Calls GetNPart on the attached DST Reader, which should return the number of particles that this event contains.
Calls the GetPartID on the attached DST Reader, which should return the particle id of the the particle at index indx.
Calls the GetPartCharge on the attached DST Reader, which should return the charge of the particle at index indx.
Call the GetPart3Vector on the attached DST Reader, which should return the TVector3 momentum vector of the particle.
Returns the TLorentzVector (4-vector) of the particle's 4-momentum. Calls GetPart3Vector and GetPartMassID(GetPartID(indx)) to construct the 4-momentum from the 3-momentum and the mass.
Call the GetPartVertex on the attached DST Reader, which should return the TVector3 vertex vector of the particle.
Correct the incorrect values for Ein or Eout (or both) in the ECPB bank for the particle stored in the TEVNTClass bank given. This routine is needed because of an error in the ECPB bank construction which occasionally has multiple copies for the same EC hit, but some of these copies are missing Ein or Eout or both. They WILL have Innstr and Outstr, which indicates that there SHOULD be a non zero entry for Ein and Eout. Further documentation can be found at: http://clasweb.jlab.org/cgi-bin/ENOTE/enote.pl?nb=eg2&action=view&page=84 So before using Ein and/or Eout from the ECPB you want to make the following lines of code, assuming *evnt is your TEVNTClass object for the event, and *ec is the TECPBObject for that event: if( ( (ec->Ein ==0 && ec->Innstr>0) || (ec->Eout == 0 && ec->Outstr>0) ) && ec->Etot>0.){ Int_t stat = cltool->Correct_ECPB_bank(evnt); } Returns in stat whether 0, 1 or 2 corrections were made to the ECPB banks values. (Created by Maurik Holtrop, UNH, 2006-03-24 )
Returns four momentum square and the invariant mass square in *Q2 and *W2./* The routines calculates the Q2 as 2 Pe Ebeam (1 - cos q) and the invariant mass W2 as Mp2+ 2 Mp (Ebeam-Pe ) - Q2, where Pe is the momentum of the scattered electron and q is the angle with respect to the beam, and Ebeam is the beam energy, Mp is the mass of the proton.
Note: To get meaningful results from this routine you must have set the beam energy correctly with SetBeamEnergy.
The code assumes that the zero-index particle is the electron.
*/
This function will return a pointer to the correct TVERTClass bank that is associated with the two tracks that are pointed to by the integer indexes into the EVNT bank, part1 and part2. Among other methods, you can locate the correct indexes for particle type X, using the TPartSieve::GetIndex()
A simple interface to read the helicity. This routine will NOT work for experiments with delayed helicity reporting. Calls the DST Readers GetHelicity() function.
Returns a pointer to the reader. Usefull for directly manipulating the reader.
Returns a pointer to the actual tree that was created by the reader. If the reader is incapable of returning a TTree, it will return NULL.
Overrides the standard print with a bit more information. Set full=1 to get even more information.
Print the event status to the terminal. (Useful for debugging.) Calls the DST Readers PrintEventStatus().
Print the position of the current EPIC in terms of its range of event numbers and run number
Set the Notify() class to Notify. This is a class that contains a routine called Notify() This method of this call will be called when the Reader loads the next file of the chain. This allows you to perform certain tasks, like loading new constants, when the file changes.
Tell the reader (TDSTReader) that you don't want to read the scaler chain, even if it exists. This is useful when filtering on data. You can only call this after the reader has been initialized.