_HADES_CLASS_DESCRIPTION HParticleTree Reconstructor to create an filtered root output. The output is generated independend for each HParticleTree reconstructor and das not affect Hades. The purpose is to create different output files with different event structure in parallel and allow to reduce the data volume for special analysis tasks (for example rare dilepton decays in Au+Au collisions). The filtering starts from HParticleCand. Only objects which are flagged kIsUsed are copied to the output. The user can specify selectLeptons() and selectHadrons() functions. By default the functions of HParticleTracksorter are used (for the documentation of the selection functions see HParticleTrackSorter). In addition the user can specify a selectEvent() function function which allows to check the full event. The program works the following way: I. The original flags of the HParticleCand objects and HParticleSorter are backupted. This alows to run the task without affecting other tasks. II. In the input HParticleCand objects are flagged using the user specified selection functions or default functions. III. If the user provides a Bool_t selectEvent(TObjArray*) function the properties of the full event can be evaluated. If the function returns kFALSE an empty event ist stored to preserve the 1 to 1 correlation with the dst file. With setSkipEmptyEvents (kTRUE) skipping of not selected events can be forced III. From HParticleCand objects which are flagged kIsUsed the selection procedure starts. Only flagged objects are considered and the detector hits belonging to the candidates are stored in the output too if enabled. With setSkipTracks(kFALSE) all tracks will forced to the output. HParticleEvtInfo, HStart2Cal, HStartHit and HWallHit are fully copied if enabled (see list below). Alternatively (not at the same time!) to using flagged candidates as selection the user can provide a function to select the kept particles by setUserkeepTrack(Bool_t (*function)(HParticleCand* )). The function has to return kTRUE for selected candidates. All indices are resorted. The new event will look like the old one, but containing only "good" candidates. The full features of the analysis of the DSTs are preserved. SUPPORTED CATEGORIES: catParticleCand catParticleMdc (extracted from HParticleCand only) catParticleEvtInfo (fullcopy only) catStart2Hit (fullcopy only) catStart2Cal (fullcopy only) catTBoxChan (fullcopy only) catWallHit (fullcopy only) catWallEventPlane (fullcopy only) catPionTrackerRaw (fullcopy only) catPionTrackerCal (fullcopy only) catPionTrackerHit (fullcopy only) catPionTrackerTrack (fullcopy only) catTofHit (fullcopy or extracted from HParticleCand) catTofCluster (fullcopy or extracted from HParticleCand) catRpcCluster (fullcopy or extracted from HParticleCand) catShowerHit (fullcopy or extracted from HParticleCand) catEmcCluster (fullcopy only) catEmcCal (fullcopy only) catRichHit (fullcopy or extracted from HParticleCand) catRichDirClus (fullcopy only) catRichCal (fullcopy only) catMdcSeg (extracted from HParticleCand only) catMdcHit (extracted from HParticleCand only) catMdcCal1 (extracted from HParticleCand only) catMdcClus (extracted from HParticleCand only) catMdcClusInf (extracted from HParticleCand only) catMdcClusFit (extracted from HParticleCand only) catMdcWireFit (extracted from HParticleCand only) catGeantKine (fullcopy only) catMdcGeantRaw (fullcopy only) catTofGeantRaw (fullcopy only) catRpcGeantRaw (fullcopy only) catShowerGeantRaw (fullcopy only) catEmcGeantRaw (fullcopy only) catWallGeantRaw (fullcopy only) catRichGeantRaw (+1,+2) (fullcopy only) create output: by 1. set outputfilename ( full name including path, dir or suffix not used) 2. by hades output name ( dir / file stem + suffix + _cyclecount.root) 3. by datasource input name ( dir / file stem + suffix + _cyclecount.root) Example: Filter dilepton events : I. use the standard selectLeptons() from HParticleTrackSorter II. ignore hadrons : take simple user defined function below III. select events which have at least 1 positron and 1 electron candidate IV. create the event structure you need //------------------------------------------------------ Bool_t selectLeptons(HParticleCand* pcand){ // selection function for lepton candidates. Bool_t select = kFALSE; if(pcand->isFlagAND(5, Particle::kIsAcceptedHitRICH, Particle::kIsAcceptedHitInnerMDC, Particle::kIsAcceptedHitOuterMDC, Particle::kIsAcceptedHitMETA, Particle::kIsAcceptedRK) && pcand->getInnerSegmentChi2() > 0 && pcand->getChi2() < 1000 && pcand->getBeta() > 0.9 ) select = kTRUE; return select; } //------------------------------------------------------ //------------------------------------------------------ Bool_t selectNoHadron(HParticleCand*){ // do not use this selection return kFALSE; } //------------------------------------------------------ Bool_t selectEvent(TObjArray* ar){ // select events which have at least // one lepton canddate pair . TObjArray* can // be used to pas parameters into the function HCategory* catCand = gHades->getCurrentEvent()->getCategory(catParticleCand); if(catCand){ Int_t n=catCand->getEntries(); HParticleCand* cand=0; Int_t nEle = 0; Int_t nPos = 0; for(Int_t i = 0; i < n; i ++){ cand = HCategoryManager::getObject(cand,catCand,i); if(cand){ if(cand->isFlagBit(kIsLepton)){ if (cand->getCharge() == -1 ) nEle++; else if (cand->getCharge() == 1 ) nPos++; } } } if( (nPos < 1 && nEle < 2) || (nPos < 2 && nEle < 1) ) return kFALSE; // accept 2likesign or 1 unlikesign pair } else return kFALSE; return kTRUE; } //------------------------------------------------------ HParticleTree* parttree = new HParticleTree("leptontree","leptontree"); // 1. set outputfilename ( full name including path, dir or suffix not used) // 2. by hades output name ( dir / file stem + suffix + _cyclecount.root) // 3. by datasource input name ( dir / file stem + suffix + _cyclecount.root) // case 1: // parttree->setOutputFile ("/lustre/hades/filter_tree.root","Filter","RECREATE",2 ); // set outfile by hand // case 2+3: partree->setOutputFileSuffix("filter_tree"); // take outfile name from Hades output or data input and add _filter_tree at the end parttree->setOutputDir("/lustre/hades"); // take outfile name from Hades output or data input and change the dir parttree->setSkipEmptyEvents(kTRUE); (default kFALSE) parttree->setSkipTracks(kTRUE); (default kTRUE) //-------CONFIGURE HParticleTrackSorter----------------- parttree->setIgnoreRICH (kTRUE); parttree->setIgnoreInnerMDC (kTRUE); parttree->setIgnoreOuterMDC (kTRUE); parttree->setIgnoreMETA (kTRUE); parttree->setIgnorePreviousIndex(kTRUE); parttree->setRICHMatching(Particle::kUseRKRICHWindowSorter, 4.); // matching type and window //------------------------------------------------------ //-------CONFIGURE EventStructure----------------------- Cat_t PersistentCat[] = { catParticleCand, catParticleMdc, catParticleEvtInfo, catStart2Hit, catStart2Cal, catTBoxChan, catWallHit, catPionTrackerTrack, //catPionTrackerRaw, //catPionTrackerCal, //catPionTrackerHit, //----------------------------- // NO OPTION FULL COPY : ONLY OBJECTS USED BY HParticleCand WILL BE COPIED! // IF YOU WANT A FULL COPY SET THE FULL COPY IN ADDIION! //catTofHit, //catTofCluster, //catRpcCluster, //catEmcCluster, //catShowerHit, //catRichHit, //----------------------------- catEmcCluster, //catRichDirClus, //catRichCal, //catMdcSeg, //catMdcHit, //catMdcCal1, //catMdcClus, //catMdcClusInf, //catMdcClusFit, //catMdcWireFit //----------------------------- // GEANT //catGeantKine, //catMdcGeantRaw, //catTofGeantRaw, //catRpcGeantRaw, //catShowerGeantRaw, //catEmcGeantRaw, //catWallGeantRaw, //catRichGeantRaw, //catRichGeantRaw+1, //catRichGeantRaw+2, //catEmcGeantRaw, //catStartGeantRaw //----------------------------- }; // list of categories which should be fully copied // (only these contained in HParticleCand as Hit Index) //----------------------------- // OPTION FULL COPY : ONLY FOR OBJECTS USED BY HParticleCand! // IF THE CAT IS SELECTED ALREADY, YOU CAN SWITCH IT TO FULL COPY HERE! Cat_t PersistentCatFullCopy[] = { //catTofHit, //catTofCluster, //catRpcCluster, //catShowerHit, //catRichHit }; //----------------------------- parttree->setEventStructure(sizeof(PersistentCat) /sizeof(Cat_t),PersistentCat,kFALSE); // filter these cats parttree->setEventStructure(sizeof(PersistentCatFullCopy)/sizeof(Cat_t),PersistentCat,kTRUE); // copy these cats witt all entries //------------------------------------------------------ //-------CONFIGURE SELECTIONS----------------------- parttree->setUserSelectionLeptons(selectLeptons); // use own lepton selector parttree->setUserSelectionHadrons(selectNoHadron); // use only standard leptons from HParticlesorter parttree->setUserSelectionEvent(selectEvent,NULL); // no params used //------------------------------------------------------
HParticleTree(const Text_t* name = "", const Text_t* title = "") | |
virtual | ~HParticleTree() |
void | TObject::AbstractMethod(const char* method) const |
virtual void | TObject::AppendPad(Option_t* option = "") |
virtual void | HReconstructor::Browse(TBrowser* b) |
static TClass* | Class() |
virtual const char* | TObject::ClassName() const |
virtual void | TNamed::Clear(Option_t* option = "") |
virtual TObject* | TNamed::Clone(const char* newname = "") const |
virtual Int_t | TNamed::Compare(const TObject* obj) const |
virtual Bool_t | HReconstructor::connectTask(HTask* task, Int_t n = 0) |
virtual void | TNamed::Copy(TObject& named) const |
virtual void | TObject::Delete(Option_t* option = "")MENU |
virtual Int_t | TObject::DistancetoPrimitive(Int_t px, Int_t py) |
virtual void | TObject::Draw(Option_t* option = "") |
virtual void | TObject::DrawClass() constMENU |
virtual TObject* | TObject::DrawClone(Option_t* option = "") constMENU |
virtual void | TObject::Dump() constMENU |
virtual void | TObject::Error(const char* method, const char* msgfmt) const |
virtual Int_t | execute() |
virtual void | TObject::Execute(const char* method, const char* params, Int_t* error = 0) |
virtual void | TObject::Execute(TMethod* method, TObjArray* params, Int_t* error = 0) |
virtual void | TObject::ExecuteEvent(Int_t event, Int_t px, Int_t py) |
virtual void | TObject::Fatal(const char* method, const char* msgfmt) const |
virtual void | TNamed::FillBuffer(char*& buffer) |
virtual Bool_t | finalize() |
virtual TObject* | TObject::FindObject(const char* name) const |
virtual TObject* | TObject::FindObject(const TObject* obj) const |
virtual HTask* | HReconstructor::getComposite() |
virtual void | HReconstructor::getConnections() |
virtual Option_t* | TObject::GetDrawOption() const |
static Long_t | TObject::GetDtorOnly() |
virtual const char* | TObject::GetIconName() const |
virtual const char* | TNamed::GetName() const |
virtual char* | TObject::GetObjectInfo(Int_t px, Int_t py) const |
static Bool_t | TObject::GetObjectStat() |
virtual Option_t* | TObject::GetOption() const |
virtual HTask* | HTask::getOwner() |
sorter_setup& | getSorterSetup() |
TObjArray | HReconstructor::getTable() |
virtual HTask* | HReconstructor::getTask(const Char_t* name) |
virtual const char* | TNamed::GetTitle() const |
virtual UInt_t | TObject::GetUniqueID() const |
virtual Bool_t | TObject::HandleTimer(TTimer* timer) |
virtual ULong_t | TNamed::Hash() const |
virtual void | TObject::Info(const char* method, const char* msgfmt) const |
virtual Bool_t | TObject::InheritsFrom(const char* classname) const |
virtual Bool_t | TObject::InheritsFrom(const TClass* cl) const |
virtual Bool_t | init() |
virtual void | TObject::Inspect() constMENU |
void | TObject::InvertBit(UInt_t f) |
virtual TClass* | IsA() const |
virtual Bool_t | TObject::IsEqual(const TObject* obj) const |
virtual Bool_t | HReconstructor::IsFolder() const |
Bool_t | TObject::IsOnHeap() const |
virtual Bool_t | TNamed::IsSortable() const |
virtual void | HReconstructor::isTimed(Bool_t flag = kTRUE) |
Bool_t | TObject::IsZombie() const |
virtual void | TNamed::ls(Option_t* option = "") const |
void | TObject::MayNotUse(const char* method) const |
virtual HTask* | HReconstructor::next(Int_t& errCode) |
virtual Bool_t | TObject::Notify() |
void | TObject::Obsolete(const char* method, const char* asOfVers, const char* removedFromVers) const |
static void | TObject::operator delete(void* ptr) |
static void | TObject::operator delete(void* ptr, void* vp) |
static void | TObject::operator delete[](void* ptr) |
static void | TObject::operator delete[](void* ptr, void* vp) |
void* | TObject::operator new(size_t sz) |
void* | TObject::operator new(size_t sz, void* vp) |
void* | TObject::operator new[](size_t sz) |
void* | TObject::operator new[](size_t sz, void* vp) |
HTask& | HTask::operator=(const HTask&) |
virtual void | TObject::Paint(Option_t* option = "") |
virtual void | TObject::Pop() |
virtual void | TNamed::Print(Option_t* option = "") const |
virtual void | HReconstructor::printTimer() |
virtual Int_t | TObject::Read(const char* name) |
virtual void | TObject::RecursiveRemove(TObject* obj) |
virtual Bool_t | HTask::reinit() |
void | TObject::ResetBit(UInt_t f) |
virtual void | HReconstructor::resetTimer() |
virtual void | TObject::SaveAs(const char* filename = "", Option_t* option = "") constMENU |
virtual void | TObject::SavePrimitive(ostream& out, Option_t* option = "") |
void | HReconstructor::setActive(Bool_t state)MENU |
void | TObject::SetBit(UInt_t f) |
void | TObject::SetBit(UInt_t f, Bool_t set) |
virtual Bool_t | HTask::setConnections() |
void | setDoSorter(Bool_t sort) |
virtual void | TObject::SetDrawOption(Option_t* option = "")MENU |
static void | TObject::SetDtorOnly(void* obj) |
void | setEventStructure(Int_t n, Cat_t* PersistentCat, Bool_t fullCopy = kFALSE) |
void | setIgnoreInnerMDC(Bool_t ignore = kTRUE) |
void | setIgnoreMETA(Bool_t ignore = kTRUE) |
void | setIgnoreOuterMDC(Bool_t ignore = kTRUE) |
void | setIgnorePreviousIndex(Bool_t ignore = kTRUE) |
void | setIgnoreRICH(Bool_t ignore = kTRUE) |
void | HTask::setManual() |
virtual void | TNamed::SetName(const char* name)MENU |
virtual void | TNamed::SetNameTitle(const char* name, const char* title) |
static void | TObject::SetObjectStat(Bool_t stat) |
void | setOutputDir(TString dir = "") |
void | setOutputFile(TString fname = "filter_tree.root", TString ftitle = "Filter", TString fopt = "RECREATE", Int_t fcomp = 2) |
void | setOutputFileSuffix(TString suff = "filter_tree") |
virtual void | HTask::setOwner(HTask* atask) |
void | setRICHMatching(Particle::ERichMatch match, Float_t window = 4.) |
void | setSkipEmptyEvents(Bool_t skip) |
void | setSkipTracks(Bool_t skip) |
void | setSortType(Particle::ESwitch type) |
virtual void | TNamed::SetTitle(const char* title = "")MENU |
virtual void | TObject::SetUniqueID(UInt_t uid) |
void | setUserkeepTrack(Bool_t (*)(HParticleCand*) function) |
void | setUserSelectionEvent(Bool_t (*)(TObjArray*) function, TObjArray* ar) |
void | setUserSelectionHadrons(Bool_t (*)(HParticleCand*) function) |
void | setUserSelectionLeptons(Bool_t (*)(HParticleCand*) function) |
virtual void | ShowMembers(TMemberInspector&) |
virtual Int_t | TNamed::Sizeof() const |
virtual void | Streamer(TBuffer&) |
void | StreamerNVirtual(TBuffer& ClassDef_StreamerNVirtual_b) |
virtual void | TObject::SysError(const char* method, const char* msgfmt) const |
Bool_t | TObject::TestBit(UInt_t f) const |
Int_t | TObject::TestBits(UInt_t f) const |
virtual void | TObject::UseCurrentStyle() |
virtual void | TObject::Warning(const char* method, const char* msgfmt) const |
virtual Int_t | TObject::Write(const char* name = 0, Int_t option = 0, Int_t bufsize = 0) |
virtual Int_t | TObject::Write(const char* name = 0, Int_t option = 0, Int_t bufsize = 0) const |
virtual void | TObject::DoError(int level, const char* location, const char* fmt, va_list va) const |
void | TObject::MakeZombie() |
void | closeOutput() |
Bool_t | doFullCopy(Cat_t cat) |
void | extractMdcCal1(Bool_t isSim, Int_t segInd) |
void | extractMdcCal1FromClus(Bool_t isSim, Int_t segInd) |
void | extractMdcSeg(HParticleCand* cand, Bool_t isSim, Int_t segInd1, Int_t& segInd2) |
Bool_t | makeTree() |
void | recreateOutput() |
void | setEvent() |
enum TObject::EStatusBits { | kCanDelete | |
kMustCleanup | ||
kObjInCanvas | ||
kIsReferenced | ||
kHasUUID | ||
kCannotPick | ||
kNoContextMenu | ||
kInvalidObject | ||
}; | ||
enum TObject::[unnamed] { | kIsOnHeap | |
kNotDeleted | ||
kZombie | ||
kBitMask | ||
kSingleKey | ||
kOverwrite | ||
kWriteDelete | ||
}; |
Bool_t | HReconstructor::fActive | Active flag |
TList* | HReconstructor::fHistograms | List of histograms generated by this reconstructor. |
Bool_t | HTask::fIsTimed | timer flag |
TString | TNamed::fName | object identifier |
TObjArray | HReconstructor::fOutputs | |
TStopwatch | HReconstructor::fTimer | Task timer |
TString | TNamed::fTitle | object title |
Bool_t | HTask::isConnected | |
Bool_t | HTask::isInitialised | |
Bool_t | HTask::manual | |
HTask* | HTask::owner |
Int_t | ctMdcClus[6][2] | ! |
Int_t | ctMdcHit[6][4] | ! |
Int_t | ctMdcSeg[6][2] | ! |
Int_t | ctRpcClus[6] | ! |
vector<Int_t> | fCatNums | ! list of persistent output categories |
HRecEvent* | fCurrentEvent | ! Event under reconstruction |
Int_t | fCycleNumber | ! cycle number of output file |
Bool_t | fOutFound | ! |
Int_t | fOutputCompression | ! output file compression |
TString | fOutputDir | ! outputdir |
TFile* | fOutputFile | ! File used to store the output tree |
TString | fOutputFileName | ! output file name (derived from hades output name) |
TString | fOutputFileSuffix | ! replace .root by fOutputFileSuffix.root |
TString | fOutputOption | ! output file option |
TString | fOutputTitle | ! output file title |
TObjArray* | fParamSelectEvent | ! object array for optional parameters of event selection function |
HTree* | fTree | ! Output tree |
map<TString,Int_t> | fmCatNameToNum | ! |
map<TString,HCategory*> | fmCatNameToPointer | ! |
vector<Int_t> | fmCatNumFullCopySupport | ! |
vector<Int_t> | fmCatNumSupport | ! |
map<Int_t,Int_t> | fmCatNumToFullCopy | ! |
map<Int_t,TString> | fmCatNumToName | ! |
map<Int_t,HCategory*> | fmCatNumToPointer | ! |
Bool_t | kDoSorter | ! kTRUE run new tracksorter (default = kTRUE) |
Bool_t | kSkipEmptyEvents | ! kTRUE = skip not selected events (default = kFALSE) |
Bool_t | kSkipTracks | ! kTRUE = skip not selected tracks (default = kTRUE) |
HSrcKeeper* | keeper | ! |
HMdcLayer* | mdclayer | ! |
HGeantMedia* | media | ! |
Bool_t (*)(HParticleCand*) | pUserKeepTrack | ! user provided function pointer to keep/discard tracks independent of sorterflags |
Bool_t (*)(TObjArray*) | pUserSelectEvent | ! user provided function pointer event selection (TObjArray for parameters) |
Bool_t (*)(HParticleCand*) | pUserSelectHadrons | ! user provided function pointer to hadron selection |
Bool_t (*)(HParticleCand*) | pUserSelectLeptons | ! user provided function pointer to lepton selection |
Particle::ESwitch | sortType | |
HParticleTrackSorter | sorter |
create output: by 1. set outputfilename ( full name including path, dir or suffix not used) 2. by hades output name ( dir / file stem + suffix + _cyclecount.root) 3. by datasource input name ( dir / file stem + suffix + _cyclecount.root)
analyzes the current event of Hades and sets the own event structure arccording to the selected categories.
fname = filename (including path) if this function is called the output filename will not be derived from Hades output (if exists) or the data input
Creates an output tree from the information in the event structure and according to the splitLevel (see setSplitLevel() )
Create new output file in case a split file is needed. Takes care of the special Hades tree features
extract HMdcSeg. HMdcHit,HMdcCal1,HMdcClus,HMdcClusInf, HMdcClusFit,HMdcWireFit are extracted for this segment it enabled.
{ sorter.getSetup().kIgnorePreviousIndex = ignore;}
{ pUserSelectEvent = function; fParamSelectEvent = ar;}