351 for (Int_t i=0; i<q.fUseTracks->GetSize(); i++)
353 TObjString* s=(TObjString*)q.fUseTracks->At(i);
357 mode=q.fUseTkMode->At(i);
358 UseTracks(s->GetString(),n,mode);
366 for (Int_t j=0; j<q.fUseDevices->GetSize(); j++)
368 TObjString* s=(TObjString*)q.fUseDevices->At(j);
369 if (s) UseDevices(s->GetString());
374 fTrackflag=q.fTrackflag;
375 fEventflag=q.fEventflag;
376 fDeviceflag=q.fDeviceflag;
377 fTrackMomenta=q.fTrackMomenta;
378 fTrackEnergies=q.fTrackEnergies;
379 fTrackMasses=q.fTrackMasses;
380 fTrackCharges=q.fTrackCharges;
381 fTrackMjds=q.fTrackMjds;
382 fTrackSecs=q.fTrackSecs;
383 fTrackIds=q.fTrackIds;
384 fTrackNsigs=q.fTrackNsigs;
388 for (Int_t k=0; k<q.fTrackUnames->GetSize(); k++)
390 TObjString* s=(TObjString*)q.fTrackUnames->At(k);
391 if (s) Select(
"track",
"user",s->GetString());
406 fEventMomenta=q.fEventMomenta;
407 fEventEnergies=q.fEventEnergies;
408 fEventMasses=q.fEventMasses;
409 fEventCharges=q.fEventCharges;
410 fEventJruns=q.fEventJruns;
411 fEventJevts=q.fEventJevts;
412 fEventWeights=q.fEventWeights;
413 fEventMjds=q.fEventMjds;
414 fEventSecs=q.fEventSecs;
418 for (Int_t l=0; l<q.fEventUnames->GetSize(); l++)
420 TObjString* s=(TObjString*)q.fEventUnames->At(l);
421 if (s) Select(
"event",
"user",s->GetString());
436 fDeviceNdevs=q.fDeviceNdevs;
437 fDeviceNhits=q.fDeviceNhits;
462 fname=gSystem->ExpandPathName(fname.Data());
465 fOutfile=
new TFile(fname.Data(),
"RECREATE",ftitle.Data());
467 fOuttree=
new TTree(tname.Data(),ttitle.Data());
485 for (Int_t i=0; i<ntrees; i++)
487 tree=(TTree*)
fTrees->At(i);
488 if (tree) tree->Write();
573 for (Int_t i=0; i<nen; i++)
575 TObjString* sx=(TObjString*)
fUseTracks->At(i);
586 TObjString* namex=
new TObjString();
587 namex->SetString(name);
630 for (Int_t i=0; i<nen; i++)
635 if (s==classname)
return;
641 TObjString* namex=
new TObjString();
642 namex->SetString(classname);
699 if (obs==
"user" && uname !=
"")
708 for (Int_t i=0; i<nen; i++)
713 if (s==uname)
return;
717 TObjString* namex=
new TObjString();
718 namex->SetString(uname);
735 if (obs==
"user" && uname !=
"")
744 for (Int_t j=0; j<nen; j++)
749 if (s==uname)
return;
753 TObjString* namex=
new TObjString();
754 namex->SetString(uname);
814 NcJob* parent=(
NcJob*)(gROOT->GetListOfTasks()->FindObject(name.Data()));
825 if (seldev->
GetSignal(
"Select") < 0.1)
return;
870 fTuser=
new Float_t*[ntunames];
871 for (Int_t i=0; i<ntunames; i++)
879 if (neunames)
fEuser=
new Float_t[neunames];
884 cout <<
" *NcTreeMaker* Selection parameters." << endl;
885 cout <<
" Selection types in use :";
892 if (ntnames) cout <<
" Track name selections to be processed (-1=all)." << endl;
893 for (Int_t i=0; i<ntnames; i++)
897 str=strx->GetString();
898 if (str==
"*") str=
"trk";
900 cout <<
" Maximally " << ntkmax <<
" track(s) per event of name : " << str.Data() << endl;
905 tree=(TTree*)
fOutfile->Get(str.Data());
909 str.ReplaceAll(
"-",
"m");
910 str.ReplaceAll(
"+",
"p");
912 tree=
new TTree(str.Data(),
"track data");
916 if (!(tree->GetBranch(
"n"))) tree->Branch(
"n",&
fTn,
"n/I");
919 if (!(tree->GetBranch(
"p"))) tree->Branch(
"p",
fTp,
"p[n]/F");
920 if (!(tree->GetBranch(
"thetap"))) tree->Branch(
"thetap",
fTthetap,
"thetap[n]/F");
921 if (!(tree->GetBranch(
"phip"))) tree->Branch(
"phip",
fTphip,
"phip[n]/F");
924 if (
fTrackMasses && !(tree->GetBranch(
"m"))) tree->Branch(
"m",
fTm,
"m[n]/F");
925 if (
fTrackCharges && !(tree->GetBranch(
"q"))) tree->Branch(
"q",
fTq,
"q[n]/F");
926 if (
fTrackMjds && !(tree->GetBranch(
"mjd"))) tree->Branch(
"mjd",
fTmjd,
"mjd[n]/D");
927 if (
fTrackSecs && !(tree->GetBranch(
"sec"))) tree->Branch(
"sec",
fTsec,
"sec[n]/D");
928 if (
fTrackIds && !(tree->GetBranch(
"id"))) tree->Branch(
"id",
fTid,
"id[n]/I");
929 if (
fTrackNsigs && !(tree->GetBranch(
"nsig"))) tree->Branch(
"nsig",
fTnsig,
"nsig[n]/I");
932 for (Int_t ituname=0; ituname<ntunames; ituname++)
936 str=strx->GetString();
939 if (!(tree->GetBranch(str.Data()))) tree->Branch(str.Data(),
fTuser[ituname],str2.Data());
948 cout <<
" Number of reference objects in Astrolab : " <<
fAstrolab->GetNRefSignals() << endl;
950 tree=(TTree*)
fOutfile->Get(
"astrotrack");
954 tree=
new TTree(
"astrotrack",
"astro track data");
958 if (!(tree->GetBranch(
"n"))) tree->Branch(
"n",&
fTn,
"n/I");
959 if (!(tree->GetBranch(
"thetap"))) tree->Branch(
"thetap",
fTthetap,
"thetap[n]/F");
960 if (!(tree->GetBranch(
"phip"))) tree->Branch(
"phip",
fTphip,
"phip[n]/F");
961 if (!(tree->GetBranch(
"icrsl"))) tree->Branch(
"icrsl",
fTe,
"icrsl[n]/F");
962 if (!(tree->GetBranch(
"icrsb"))) tree->Branch(
"icrsb",
fTm,
"icrsb[n]/F");
963 if (!(tree->GetBranch(
"mjd"))) tree->Branch(
"mjd",
fTmjd,
"mjd[n]/D");
964 if (
fTrackSecs && !(tree->GetBranch(
"sec"))) tree->Branch(
"sec",
fTsec,
"sec[n]/D");
967 if ((
fTrackflag && ntnames) ||
fAstrolab) cout <<
" --- Max. number of output tracks per event per name : " <<
fNtkmax << endl;
976 tree=
new TTree(
"evt",
"event data");
980 if (
fEventJruns && !(tree->GetBranch(
"jrun"))) tree->Branch(
"jrun",&
fEjrun,
"jrun/I");
981 if (
fEventJevts && !(tree->GetBranch(
"jevt"))) tree->Branch(
"jevt",&
fEjevt,
"jevt/I");
983 if (
fEventMjds && !(tree->GetBranch(
"mjd"))) tree->Branch(
"mjd",&
fEmjd,
"mjd/D");
984 if (
fEventSecs && !(tree->GetBranch(
"sec"))) tree->Branch(
"sec",&
fEsec,
"sec/D");
987 if (!(tree->GetBranch(
"p"))) tree->Branch(
"p",&
fEp,
"p/F");
988 if (!(tree->GetBranch(
"thetap"))) tree->Branch(
"thetap",&
fEthetap,
"thetap/F");
989 if (!(tree->GetBranch(
"phip"))) tree->Branch(
"phip",&
fEphip,
"phip/F");
992 if (
fEventMasses && !(tree->GetBranch(
"m"))) tree->Branch(
"m",&
fEm,
"m/F");
996 for (Int_t ieuname=0; ieuname<neunames; ieuname++)
1000 str=strx->GetString();
1003 if (!(tree->GetBranch(str.Data()))) tree->Branch(str.Data(),&
fEuser[ieuname],str2.Data());
1009 if (ndnames) cout <<
" Device classname selections to be processed." << endl;
1010 for (Int_t j=0; j<ndnames; j++)
1013 if (!strx)
continue;
1014 str=strx->GetString();
1015 cout <<
" Devices (derived from) : " << str.Data() << endl;
1018 tree=(TTree*)
fOutfile->Get(str.Data());
1022 tree=
new TTree(str.Data(),
"device data");
1026 if (
fDeviceNdevs && !(tree->GetBranch(
"ndev"))) tree->Branch(
"ndev",&
fDndev,
"ndev/I");
1027 if (
fDeviceNhits && !(tree->GetBranch(
"nhit"))) tree->Branch(
"nhit",&
fDnhit,
"nhit/I");
1075 for (Int_t i=0; i<nnames; i++)
1078 if (!strx)
continue;
1079 str=strx->GetString();
1084 fEvt->GetTracks(0,2,0,&tracks);
1089 fEvt->GetTracks(str,tkmode,&tracks);
1091 ntk=tracks.GetEntries();
1092 if (ntkmax>0 && ntk>ntkmax) ntk=ntkmax;
1098 for (Int_t jtk=0; jtk<ntk; jtk++)
1100 track=(
NcTrack*)tracks.At(jtk);
1101 if (!track)
continue;
1119 fTsec[
fTn]=double(s)+double(ns)*1.e-9+double(ps)*1.e-12;
1124 for (Int_t
id=0;
id<ndnames;
id++)
1127 if (!strx)
continue;
1128 str2=strx->GetString();
1133 for (Int_t ituname=0; ituname<ntunames; ituname++)
1137 if (!strx)
continue;
1138 str2=strx->GetString();
1147 str.ReplaceAll(
"-",
"m");
1148 str.ReplaceAll(
"+",
"p");
1149 tree=(TTree*)
fOutfile->Get(str.Data());
1150 if (tree) tree->Fill();
1163 TTree* tree=(TTree*)
fOutfile->Get(
"evt");
1170 p=
fEvt->Get3Momentum();
1172 fEvt->GetMJD(mjd,s,ns);
1179 fEsec=double(s)+double(ns)*1.e-9+double(ps)*1.e-12;
1190 for (Int_t ieuname=0; ieuname<neunames; ieuname++)
1194 if (!strx)
continue;
1195 str=strx->GetString();
1219 for (Int_t i=0; i<nnames; i++)
1222 if (!strx)
continue;
1223 str=strx->GetString();
1229 tree=(TTree*)
fOutfile->Get(str.Data());
1230 if (tree) tree->Fill();
1265 for (Int_t jtk=1; jtk<=ntk; jtk++)
1291 fTsec[
fTn]=double(s)+double(ns)*1.e-9+double(ps)*1.e-12;
1296 TTree* tree=(TTree*)
fOutfile->Get(
"astrotrack");
1297 if (tree) tree->Fill();
1314 if (strlen(name)) sel->SetName(name);
Handling of 3-vectors in various reference frames.
Double_t GetX(Int_t i, TString f, TString u="rad")
void SetVector(Double_t *v, TString f, TString u="rad")
Double_t GetX(Int_t i, TString f, TString u="rad")
NcSignal * GetUserData() const
Virtual lab to provide (astro)physical parameters, treat data and relate observations with astrophysi...
Signal (Hit) handling of a generic device.
Creation and investigation of an NCFS generic event structure.
Base class for top level job in a task based procedure.
TObject * GetObject(const char *classname) const
NcTimestamp * GetTimestamp()
Generic handling of (extrapolated) detector signals.
virtual Float_t GetSignal(Int_t j=1, Int_t mode=0) const
Handling of timestamps for (astro)particle physics research.
Double_t GetMJD(Int_t y, Int_t m, Int_t d, Int_t hh, Int_t mm, Int_t ss, Int_t ns) const
Handling of the attributes of a reconstructed particle track.
NcTimestamp * GetTimestamp()
Int_t GetNsignals() const
Double_t GetEnergy(Float_t scale=-1)
Double_t GetMass(Float_t scale=-1)
Float_t GetCharge() const
Double_t GetMomentum(Float_t scale=-1)
TTask derived class to generate a plain ROOT tree from NCFS generic event structures.
Float_t fEm
! Variable for event data storage in output tree
Float_t fEq
! Variable for event data storage in output tree
Float_t * fTq
! Array for track data storage in output tree
Float_t fEe
! Variable for event data storage in output tree
Double_t fEsec
! Variable for event data storage in output tree
void Select(TString type, TString obs, TString uname="")
NcTreeMaker(const char *name="NcTreeMaker", const char *title="ROOT tree data generation")
Double_t * fTsec
! Array for track data storage in output tree
Float_t * fTthetap
! Array for track data storage in output tree
Int_t fEjrun
! Variable for event data storage in output tree
Float_t * fEuser
! Variable for event data storage in output tree
Float_t * fTp
! Array for track data storage in output tree
Int_t fDnhit
! Variable for device data storage in output tree
Float_t * fTm
! Array for track data storage in output tree
Double_t fEweight
! Variable for event data storage in output tree
virtual void Exec(Option_t *opt)
Int_t fTn
! Number of tracks in the output tree storage array
Int_t fDndev
! Variable for device data storage in output tree
Float_t ** fTuser
! Matrix array for track data storage in output tree
void SetAstrolab(NcAstrolab *lab)
Float_t fEp
! Variable for event data storage in output tree
virtual TObject * Clone(const char *name="") const
NcAstrolab * GetAstrolab() const
Int_t * fTnsig
! Array for track data storage in output tree
Float_t * fTphip
! Array for track data storage in output tree
void SetTrackMaximum(Int_t n)
Double_t * fTmjd
! Array for track data storage in output tree
Int_t fEjevt
! Variable for event data storage in output tree
Int_t * fTid
! Array for track data storage in output tree
Double_t fEmjd
! Variable for event data storage in output tree
Float_t fEphip
! Variable for event data storage in output tree
void UseDevices(TString classname)
Float_t * fTe
! Array for track data storage in output tree
void SetOutputFile(TString fname, TString ftitle, TString tname="Data", TString ttitle="All event data")
void UseTracks(TString name, Int_t n=-1, Int_t mode=0)
Float_t fEthetap
! Variable for event data storage in output tree