#include "TPartSieve.h" |
virtual void | TObject::DoError(int level, const char* location, const char* fmt, va_list va) const |
void | TObject::MakeZombie() |
enum E_SortFlag_state { | kSortFlag_SortOn | |
kSortFlag_ConfidenceOn | ||
kSortFlag_RefineIdOn | ||
}; | ||
enum TObject::EStatusBits { | kCanDelete | |
kMustCleanup | ||
kObjInCanvas | ||
kIsReferenced | ||
kHasUUID | ||
kCannotPick | ||
kNoContextMenu | ||
kInvalidObject | ||
}; | ||
enum TObject::[unnamed] { | kIsOnHeap | |
kNotDeleted | ||
kZombie | ||
kBitMask | ||
kSingleKey | ||
kOverwrite | ||
kWriteDelete | ||
}; |
Float_t | fEC_U_Cut | |
Float_t | fEC_V_Cut | |
Float_t | fEC_W_Cut | |
Float_t | fEC_U_Cut_width | |
Float_t | fEC_V_Cut_width | |
Float_t | fEC_W_Cut_width | |
Float_t | fEC_Eio_slope | |
Float_t | fEC_Eio_off | |
Float_t | fEC_Ein_cut | |
Float_t | fEC_Eout_cut | |
Float_t | fCC_Phe_cut | |
Float_t | fCC_Phe_width | |
Float_t | fConf_Pim_DT_min | |
Float_t | fConf_Pim_DT_max | |
Float_t | fConf_Pip_DT_min | |
Float_t | fConf_Pip_DT_max | |
Float_t | fConf_Km_DT_min | |
Float_t | fConf_Km_DT_max | |
Float_t | fConf_Kp_DT_min | |
Float_t | fConf_Kp_DT_max | |
Float_t | fConf_Prot_DT_min | |
Float_t | fConf_Prot_DT_max | |
Float_t | fConf_Deut_DT_min | |
Float_t | fConf_Deut_DT_max | |
Float_t | fConf_He3_DT_min | |
Float_t | fConf_He3_DT_max | |
Float_t | fConf_He4_DT_min | |
Float_t | fConf_He4_DT_max | |
Float_t | fConf_Neut_DT_min | |
Float_t | fConf_Neut_DT_max | |
Float_t | fConf_El_DC_chi2 | |
Float_t | fConf_Prot_DC_chi2 | |
Float_t | fConf_Pim_DC_chi2 | |
Float_t | fConf_Pip_DC_chi2 | |
Float_t | fConf_Km_DC_chi2 | |
Float_t | fConf_Kp_DC_chi2 | |
Float_t | fConf_Deut_DC_chi2 | |
Float_t | fConf_He3_DC_chi2 | |
Float_t | fConf_He4_DC_chi2 | |
Float_t | fConf_El_DC_chi2_width | |
Float_t | fConf_Prot_DC_chi2_width | |
Float_t | fConf_Pim_DC_chi2_width | |
Float_t | fConf_Pip_DC_chi2_width | |
Float_t | fConf_Km_DC_chi2_width | |
Float_t | fConf_Kp_DC_chi2_width | |
Float_t | fConf_Deut_DC_chi2_width | |
Float_t | fConf_He3_DC_chi2_width | |
Float_t | fConf_He4_DC_chi2_width | |
vector<int> | fvBadPaddles | |
TClasTool* | fCT | This is a pointer to the actual reader used. |
UShort_t | fSortFlag | This flag controls the mode of the Sieve |
Int_t | fDebug_Mode | Sets the verbosity of the code. |
Int_t | fIndexSave | used by IDtoInd and IDtoIndQuick for faster use |
Float_t | fRefConfidenceCut | when Refining Id's parts with less than this confidence will be refined |
Float_t | fConfidenceCut | Minimum confidence for Sieve to store a particle |
Int_t | fNPart[13] | Stores the numbers of each type of particle in an event |
Int_t | fIndex[13][10] | Stores the particle index in the EVNT bank |
Float_t | fConfidence[13][10] | Confidence level in particle id |
____________________
Created at UNH by Will Morrison and Maurik Holtrop
TPartSieve is part of the CLASTOOL analysis framework. It is designed to facilitate physics analysis by providing a structure that can be customized to a specific analysis with custom cuts, etc., without changing the details of how the functions are used in an analysis program. These customizations are easy to make, and TPartSieve is designed for easy use and easy comprehension.
The Sieve can be run over an entire event in one of three modes, either Sort, Confidence or Refine. Sort mode is useful for preliminary looks at data. It is also useful in code that already has Sieve mechanisms in place but no longer needs to use the Confidence or Refinement. This mode makes looking at specific particles very easy; one can for example loop through all pions in an event using only two lines of code.
Confidence mode assigns a confidence level to each particles ID, and throws away particles below an ajustable confidence level. The confidence level is determined using a set of particle specific functions. See the function GetConfidence() for an explanation of the confidence level setting scheme.
Refine mode looks through particles and find ones with less than adequate confidence. It then determines what the id should be using a set of particle specific functions. These are NOT CURRENTLY IMPLEMENTED.
Running over one run and using this class's sort function and filling a histogram with the number of each particle took 34.5 seconds. A comparable program using only TClasTool took 31.6 seconds.
Additional information about this package, including an overview, can be found at the ClasTool Documentation web pages.
Class Constructor, setting up PartSieve properly with a TClasTool The runnum argument may be used later when we couple to a database to get constants for cuts for a specific run. It is not used now.
Calling this function turns on a flag that causes SieveEvent() to count and store the number of each particle and store each particle's index into the EVNT bank. This is useful for getting how many of a certain particle are in an event. It is also useful because it is easy to tell it to get, for example, the second kaon+, using GetEVNT. This should also be used in combination with the other two modes, in order for one to look at the particles he has just analyzed.
Calling this function turns on a flag that causes SieveEvent() to calculate and store a confidence level in each particle's id. Use this to measure the confidence level in each particle's RECSIS id. For example if a particle's RECSIS id is proton and this function assigns a confidence of .65, there is a 65% chance that it is actually a proton.
Calling this function turns on a flag that causes SieveEvent() to recalculate the id of each particle in the event. This mode will actually change the particle id's that were assigned in RECSIS. Make sure you understand what the refinements are actually doing before you use this mode!
Set verbosity of code Debug Mode = -1 : Absolutely no output Debug Mode = 0 : Warning Messages only. Debug Mode = 1 : Helpful non-warning messages and warning for too many particles in event.
This function looks over each particle in the event. It can do the following in any combination: 1. Count and save the number of each type of particle in the event, as well as the EVNT index of each particle. These particles can then be accessed by telling the Sieve to get the 0th, 1st, 2nd etc. of such and such a particle. 2. Calculate the confidence that the RECSIS particle id is correct, however this is only useful if you then save this info using option 1. 3. Recalculate the particle id and save this new id.
THIS FUNCTION HAS BEEN WRITTEN FOR INTERNAL USE ONLY AND IS NOT ACCESSIBLE TO THE USER. This will properly save a particle's index into the EVNT bank. It will also incremement its counter. This routine saves the particle confidence if in the SetConfidence mode.
This function returns the confidence level that the particle with EVNT index Ind's RECSIS id is correct. For example if a particle's RECSIS id is proton and this function /returns a confidence of .65, there is a 65% chance that it is actually a proton. The confidence level is set using a two-tiered system. The first tier consists of the Conf### functions, where ### is the particle name. In these functions the cuts that are to be used on the specific particle are selected. These functions also may contain code for a cut that is specific to a certain particle, however this should be very limited. The second tier of the system is the Cut functions themselves. The general idea for these functions is that there is an ideal value of quantity that a particle may have. The experimental value will differ from this ideal value. The user inputs the maximum difference between ideal and experimental and the weight of this cut into the functions as arguements. These functions are meant to be general and may require additional arguements such as the mass of the particle in question.
THIS IS CURRENTLY TOTALLY NON FUNCTIONAL. The thought behind it may even be flawed....
Get the number of particles with PartId in last sorted event. Returns negative on error. See GetNIdx(Int_t idx) (inlined function) for doing the same from an index.
Get the index into the EVNT bank for the numth PartId. Indexes start at 0. Returns negative on error.
Get the index into the EVNT bank for the numth Idx. Indexes start at 0. Returns negative on error.
Returns a pointer to the TEVNTClass for the numth INDEX, starting at index 0. Returns NULL on error.
Returns a pointer to the TEVNTClass for the numth PartID, starting at index 0. Returns NULL on error.
If you wish to save a particle confidence you have got independently of SieveEvent, this will save it in the numth slot of PartId
Prints the number of each type of particle in the event and the SortFlag value. You must call SieveEvent() first to see anything meaningful.
Returns the confidence from from the table. This table is constructed if the routine is run with ConfidenceOn(). Returns negative on error.
This transforms a particle index to the particle id#. This is a passthrough call to TClasTool::GetPidFromType.
The Conf functions select the cuts that are relevent to their particle. There is a seperate function for each particle because it keeps the code easy to read and straightforward. It is also the job of these functions to select the weight of each cut and how much range the cut should have. Calculate the confidence that particle with EVNT index Ind is an electron.
Calculate the confidence that particle with EVNT index Ind is a Pi+. Currently this is a hard cut on DeltaT, between fConf_Pim_DT_min and fConf_Pim_DT_max
Calculate the confidence that particle with EVNT index Ind is a Pi-. Currently this is a hard cut on DeltaT, between fConf_Pip_DT_min and fConf_Pip_DT_max
Calculate the confidence that particle with EVNT index Ind is a proton. Currently this is a hard cut on DeltaT, between fConf_Prot_DT_min and fConf_Prot_DT_max
Calculate the confidence that particle with EVNT index Ind is an electron
Calculate the confidence that particle with EVNT index Ind is a positron. This calls the routine for the electron: ConfEl(Ind,0.)
Calculate the confidence that particle with EVNT index Ind is a neutron.
Calculate the confidence that particle with EVNT index Ind is a K+. Currently this is a hard cut on DeltaT, between fConf_Pip_DT_min and fConf_Pip_DT_max
Calculate the confidence that particle with EVNT index Ind is a K-. Currently this is a hard cut on DeltaT, between fConf_Pip_DT_min and fConf_Pip_DT_max
Calculate the confidence that particle with EVNT index Ind is a deuteron.
Calculate the confidence that particle with EVNT index Ind is a Helium 3.
Calculate the confidence that particle with EVNT index Ind is a Helium 4.
This function changes the id of the particle in the ClasTool bank with index Ind to the ID in the arguement.
Set the minimum confidence a particle may have and be saved in the Sieve
Set the minimum confidence a particle may have if it is not to be refined
In these Cut functions the difference between an ideal value and the experimental value is calculated. The difference is scaled so that a difference of MaxDiff is scaled to 1, values less are less than 1 and values greater than MaxDiff are greater than 1. The scaled difference is then multiplied by Weight and returned. The returned value is meant to be subtracted from the confidence. Compares the Beta from EVNT class with betta found using the formula B= p/sqrt(p^2 + m^2).m is the input parameter mass. Use the accepted value. Weight is a measure of how severe the cut is. Returns the reduction in confidence.
Helper function. This function return 1 if x is below cut-width/2. It will return 0 if x is above cut+width/2. Between cut-width/2 and cut+width/2 it returns a value between 1 and 0 decreasing linearly.
Helper function. This function return 0 if x is below cut-width/2. It will return 1 if x is above cut+width/2. Between cut-width/2 and cut+width/2 it returns a value between 0 and 1 increasing linearly.
See Float_t TPartSieve::ECUVWCut(TEVNTClass *evnt, Float_t WidthMultiply)
This function cuts on the U,V and W coordinate on the EC plane. These cuts make sure we do not use the events that are too close to the edge where some of the shower could have leaked out of the calorimeter. Instead of a hard cut, where the function would return 1 if you are inside and 0 if you are outside, each cut specifies a "width". The function returns a value of 0 or 1 outside this widht, and inside the width it returns a value bewteen 0 and 1. The "WidthMultiply" parameter allows you to stretch or shrink these widths. So WidthMultiply=0 will give you the standard 1 or 0 behavior. Cuts are specified by fEC_U_Cut, fEC_V_Cut and fEC_W_Cut, where the U cut is a cut on minumum U, and the V and W cuts are maxima. The widths for these cuts are set in fEC_?_Cut_width. Reasonable defaults are choosen for these cuts, but you probably want to fine tune them for your analysis.
See TPartSieve::EC_Eio_Cut((TEVNTClass *evnt,Float_t WidthMultiply)
This performs a cut on the EC Inner energy versus the EC Outer energy to identify good electrons. The cut is a line: Eout/p >= Off - Slope* Ein/p Where Off=0.156 , Slope=1 is standard. Right now this is a hard cut, returning 0 or 1.
Get the DeltaT (difference between flight time calculated from sc hit and from momentum, see below) for event *evnt. First checks whether there was an SC hit, if not returns -1000. Next, checks whether the SC paddle is on the bad paddle list, if so, returns -999. If neither of the above, it returns the DeltaT by calling the routine below.
Returns the difference between flight time calculated from the scintellator hit time dt_sc=(sc->Time - head->STT) and the flight time calculated from the momentum: dt_p=sc->Path/(29.9*betap), where betap = p/(p*p+m*m) , with m the guessed at particle mass. This should thus be zero if the mass is guessed correctly and resolution is perfect. No checking is done for the validity of the *sc pointer! Returns the DeltaT.
Same at GetDeltaT, but for the flight path to the EC. Returns the difference between flight time calculated from the EC hit time dt_ec=(ec->Time - head->STT) and the flight time calculated from the momentum: dt_p=ec->Path/(29.9*betap), where betap = p/(p*p+m*m) , with m the guessed at particle mass. This should thus be zero if the mass is guessed correctly and resolution is perfect.
Check the quality of the track. If no DC at all or TEVNTClass::GetDCStat<=0 return 0. Also return 0. if the TEVNTClass:GetStat()<=0; This filters out the hit based only tracks. Else, compare the Chi2 requested with the Chi2 of the track.
Cut on the number of CC photons, given an index.
Set a paddle as bad in bad paddle list. Returns the new number of bad paddles;
==================================================================================== This transforms particle id to particle index. This is a passthrough call to TClasTool::GetTypeFromPid, but in addition stores the value in fIndexSave for later retrieval with IDtoIndQuick(). (inline function);
============================================================================== returns the last value found by IDtoInd. This avoids doing multiple searches.
This function should be somewhere else (ie. the vertex class, but I need it for an analysis and this was the simplest place to put it.