//*-- Author : B. Spruck //*-- Modified : 7 May 2008 B. Spruck //_HADES_CLASS_DESCRIPTION //////////////////////////////////////////////////////////////////////// // // HHypAllFillerInclusiveAlg // // This Algorythm allows for easy selection of reactions in your macro // because reaction can be given by option string. // // Example: // hyp->AddAlgorithm("empty",new HHypAllFillerInclusiveAlg("Test of All Filler", // standardHypOption + "Reactions=(p p e+ e-;g) " // "(p p pi+ pi-;pi0 g dummy) (p p pi+ pi-) ," // " someotheroption=false"),"AllFill"); // // Syntax: // Reactions=(reaction1)(reaction2)(reaction3) // where reaction1 is consits of a part with the wanted particles, // followed by an semicolon and the missing particles // Example: ( p p e+ e- ; g pi0 dummy ) // particle names are seperated by spaces // the "dummy" particle tells the filler that no missing particle is // expected (needed for kinematic fitting). If there are several missing // particles defined, this will result in several reactions, the upper // example is a shortcut for // ( p p e+ e- ; g) // ( p p e+ e- ; pi0) // ( p p e+ e- ) which is equivalent to ( p p e+ e- ; dummy) // // If you dont follow these syntax rules, result might be "interessting" // wrong particle names will result in non-fatal errors, therefore // watch output carefully // // Number of reactions is limited to 20 but can be increased easily // Number of particles is limited to 10, this is limited by Filler // //////////////////////////////////////////////////////////////////////// using namespace std; #include #include #include "hhypAllFillerInclusiveAlg.h" #include "hypinfodef.h" ClassImp(HHypAllFillerInclusiveAlg) HHypAllFillerInclusiveAlg::HHypAllFillerInclusiveAlg(Char_t *name_i, Option_t par[]) :HHypBaseAlgorithm(name_i,par) { for(Int_t i=0; iexecute(); // cout <=0) nr++; } } if (nr ==0) return kFALSE; // cout < "; HHypList *hyplist_s = NULL; HCategory *listCat = gHades->getCurrentEvent()->getCategory(catHypList); if(!listCat){ Error("execute","listCat!=0"); } hyplist_s = (HHypList *) listCat->getObject(nrs[0]); if( hyplist_s==0){ Error("execute","hyplist_s==0"); exit(0); } // cout <getObject(nrs[i]); if(hyplist_j){ hyplist_s->Join(hyplist_j); }else { Error("execute","hyplist_j==0"); exit(0); } } // cout << endl; exitIdx=nrs[0]; // cout << "Filler Exit List ID " <print(); return kTRUE; } Bool_t HHypAllFillerInclusiveAlg::InitFillers(Int_t &fnr,Int_t particles_anz,Int_t *particles,Int_t missing_anz,Int_t *missing) { Bool_t flag=false; if(particles_anz>0){ cout << "HypAllFillerInclusiveAlg "<SetExitList(0x7FFFF000+fnr); for(Int_t pi=0; piAddTrack(particles[pi]); } cout << " :"; for(Int_t mi=0; miAddOneMissing(missing[mi]); } cout << endl; flag|=filler[fnr]->init(); fnr++; }else{ cerr << "HypAllFillerInclusiveAlg: No Particles defined!"<Data(); if(abc==NULL){ Error("HHypAllFillerInclusiveAlg","No Reactions defined in Option String by Reactions=()()()"); return(false); } cout << "HypAllFillerInclusiveAlg ("<GetEntries(); // Format: "( , , , ;)(, , , , ;)" for(Int_t j=0; jAt(j))->String(); reac_str.Remove(TString::kBoth,' '); if(reac_str.Length()<2) continue; TObjArray *partmissdiv_arr; partmissdiv_arr=reac_str.Tokenize(";"); if(partmissdiv_arr->GetEntries()>2){ cerr<<"HypAllFillerInclusiveAlg: Parse Error in Reaction >>"<>"<GetEntries()>=1){ { TObjArray *part_arr; part_arr=((TObjString *)partmissdiv_arr->At(0))->String().Tokenize(" "); for(Int_t k=0; kGetEntries(); k++){ TString part_str; part_str=((TObjString *)part_arr->At(k))->String(); part_str.Remove(TString::kBoth,' '); particles[particles_anz]=HPhysicsConstants::pid(part_str); if(particles[particles_anz]!=0){ particles_anz++; if(particles_anz==11){ cerr << "HypAllFillerInclusiveAlg: number of particles exceeds 10!"<GetEntries()==2){ TObjArray *miss_arr; miss_arr=((TObjString *)partmissdiv_arr->At(1))->String().Tokenize(" "); for(Int_t k=0; kGetEntries(); k++){ TString miss_part; miss_part=((TObjString *)miss_arr->At(k))->String(); miss_part.Remove(TString::kBoth,' '); if(miss_part.Length()>0){ } missing[missing_anz]=HPhysicsConstants::pid(miss_part); if(missing[missing_anz]!=0 || miss_part=="dummy"){ missing_anz++; if(missing_anz==11){ cerr << "HypAllFillerInclusiveAlg: number of missing particles exceeds 10!"<