159 if (split>=0)
fSplit=split;
171 if (bsize>=0)
fBsize=bsize;
188 TObjString* s=
new TObjString();
214 fOutfile=
new TFile(name.Data(),
"RECREATE",
"Simple Root data in IceEvent structure");
253 cout <<
" *IceRootx Exec* No data input file(s) specified." << endl;
257 Int_t ninfiles=
fInfiles->GetEntries();
260 cout <<
" *IceRootx Exec* No data input file(s) specified." << endl;
268 otree=
new TTree(
"T",
"Simple Root data converted to IceEvent structures");
278 if (otree) otree->Branch(
"IceEvent",
"IceEvent",&evt,
fBsize,
fSplit);
285 cout <<
" ***" << endl;
286 cout <<
" *** Start processing of job " << GetName() <<
" ***" << endl;
287 cout <<
" ***" << endl;
288 for (Int_t i=0; i<ninfiles; i++)
290 TObjString* sx=(TObjString*)
fInfiles->At(i);
292 inputfile=sx->GetString();
293 cout <<
" Simple Root data input file : " << inputfile.Data() << endl;
295 cout <<
" Maximum number of events to be processed : " <<
fMaxevt << endl;
296 cout <<
" Print frequency : " <<
fPrintfreq << endl;
299 cout <<
" ROOT output file : " <<
fOutfile->GetName() << endl;
300 cout <<
" Output characteristics : splitlevel = " <<
fSplit <<
" buffersize = " <<
fBsize << endl;
313 trig.SetNameTitle(
"Trigger",
"Amanda/IceCube event triggers");
317 Double_t triggertime=0;
318 Int_t eventtimemjd=0;
319 Int_t eventtimemjds=0;
320 Int_t eventtimemjdns=0;
345 Float_t pi=acos(-1.);
347 Int_t firstomonstring[20];
348 firstomonstring[0]=0;
349 firstomonstring[1]=1;
350 firstomonstring[2]=21;
351 firstomonstring[3]=41;
352 firstomonstring[4]=61;
353 firstomonstring[5]=87;
354 firstomonstring[6]=123;
355 firstomonstring[7]=159;
356 firstomonstring[8]=195;
357 firstomonstring[9]=231;
358 firstomonstring[10]=267;
359 firstomonstring[11]=303;
360 firstomonstring[12]=345;
361 firstomonstring[13]=387;
362 firstomonstring[14]=429;
363 firstomonstring[15]=471;
364 firstomonstring[16]=513;
365 firstomonstring[17]=555;
366 firstomonstring[18]=597;
367 firstomonstring[19]=639;
371 for (Int_t ifile=0; ifile<ninfiles; ifile++)
373 TObjString* sx=(TObjString*)
fInfiles->At(ifile);
376 inputfile=sx->GetString();
377 if (inputfile==
"")
continue;
380 input=TFile::Open(inputfile);
384 cout <<
" *IceRootx Exec* No input file found with name : " << inputfile.Data() << endl;
389 fTree=(TTree*)input->Get(
"T");
390 fTree->SetBranchAddress(
"triggertime",&triggertime);
391 fTree->SetBranchAddress(
"eventtimemjd",&eventtimemjd);
392 fTree->SetBranchAddress(
"eventtimemjds",&eventtimemjds);
393 fTree->SetBranchAddress(
"eventtimemjdns",&eventtimemjdns);
394 fTree->SetBranchAddress(
"eventid",&eventid);
395 fTree->SetBranchAddress(
"runid",&runid);
396 fTree->SetBranchAddress(
"String",&String);
397 fTree->SetBranchAddress(
"OM",&OM);
398 fTree->SetBranchAddress(
"baseline",&baseline);
399 fTree->SetBranchAddress(
"type",&type);
400 fTree->SetBranchAddress(
"numberbins",&numberbins);
401 fTree->SetBranchAddress(
"starttime",&starttime);
402 fTree->SetBranchAddress(
"ntracks",&ntracks);
403 if(
fTree->GetBranch(
"binsize"))
fTree->SetBranchAddress(
"binsize",&binsize);
405 Int_t nmaxbins=(Int_t)
fTree->GetLeaf(
"numberbins")->GetMaximum();
406 Float_t* wvform=
new Float_t[nmaxbins+1];
407 fTree->SetBranchAddress(
"wvform",wvform);
409 Int_t nmaxtracks=(Int_t)
fTree->GetLeaf(
"ntracks")->GetMaximum();
410 Float_t* trackx=
new Float_t[nmaxtracks];
411 Float_t* tracky=
new Float_t[nmaxtracks];
412 Float_t* trackz=
new Float_t[nmaxtracks];
413 Double_t* trackenergy=
new Double_t[nmaxtracks];
414 Float_t* trackzenith=
new Float_t[nmaxtracks];
415 Float_t* trackazimuth=
new Float_t[nmaxtracks];
416 Int_t* tracktype=
new Int_t[nmaxtracks];
417 fTree->SetBranchAddress(
"trackx",trackx);
418 fTree->SetBranchAddress(
"tracky",tracky);
419 fTree->SetBranchAddress(
"trackz",trackz);
420 fTree->SetBranchAddress(
"trackenergy",trackenergy);
421 fTree->SetBranchAddress(
"trackzenith",trackzenith);
422 fTree->SetBranchAddress(
"trackazimuth",trackazimuth);
423 fTree->SetBranchAddress(
"tracktype",tracktype);
429 for(Int_t ientry=0; ientry<
fTree->GetEntries(); ientry++)
431 fTree->GetEntry(ientry);
434 if(eventid!=lastevent)
442 if(otree) otree->Fill();
457 evt->
SetMJD(eventtimemjd,eventtimemjds,eventtimemjdns,0);
464 s.SetTitle(
"First trigger for TWR time reference");
475 for (Int_t itrack=0; itrack<ntracks; itrack++)
480 vec[0]=trackx[itrack];
481 vec[1]=tracky[itrack];
482 vec[2]=trackz[itrack];
487 vec[0]=trackenergy[itrack];
488 vec[1]=pi-trackzenith[itrack];
489 vec[2]=trackazimuth[itrack]+pi;
490 if(vec[2]>=2*pi) vec[2]-=2*pi;
495 if(trackx[itrack]!=trackx[itrack] || tracky[itrack]!=tracky[itrack] || trackz[itrack]!=trackz[itrack] ||
496 trackzenith[itrack]!=trackzenith[itrack] || trackazimuth[itrack]!=trackazimuth[itrack]){
502 if(tracktype[itrack]==7){
509 t.
SetId(nrecotracks);
511 if(tracktype[itrack]==1) { t.SetName(
"I3CFIRST"); t.SetTitle(
"IceTray CFIRST track"); }
512 else if(tracktype[itrack]==2) { t.SetName(
"I3direct"); t.SetTitle(
"IceTray direct walk track"); }
513 else if(tracktype[itrack]==3) { t.SetName(
"I3Jams_cluster"); t.SetTitle(
"IceTray Jams cluster"); }
514 else if(tracktype[itrack]==4) { t.SetName(
"I3Jams_qual"); t.SetTitle(
"IceTray Jams quality"); }
515 else if(tracktype[itrack]==5) { t.SetName(
"I3TOIFit"); t.SetTitle(
"IceTray TOI fit"); }
516 else if(tracktype[itrack]==6) { t.SetName(
"I3line-direct"); t.SetTitle(
"IceTray line direct walk"); }
517 else if(tracktype[itrack]==7) { t.SetName(
"I3MCTrack"); t.SetTitle(
"I3MCTrack"); }
518 else { t.SetName(
"Unknown"); t.SetTitle(
"IceTray track of unknown type"); }
529 omid=firstomonstring[-String]+OM-1;
530 if(omid==681)
continue;
535 om.SetUniqueID(omid);
550 else if(type==1) omx->
SetSignal(2,
"READOUT");
551 else if(type==2) omx->
SetSignal(3,
"READOUT");
561 histo.SetName(hname.Data());
562 histo.SetBins(numberbins,triggertime+starttime,triggertime+starttime+numberbins*binsize);
564 for (Int_t jbin=1; jbin<=numberbins; jbin++)
566 histo.SetBinContent(jbin,baseline-wvform[jbin-1]);
578 if (otree) otree->Fill();
596 delete[] trackenergy;
597 delete[] trackzenith;
598 delete[] trackazimuth;
Signal (Hit) handling of a generic Amanda Optical Module (AOM).
Handling of IceCube event data.
Job for conversion of simple Root data into IceEvent data structures.
void SetBufferSize(Int_t bsize)
IceRootx(const char *name="IceRootx", const char *title="")
virtual void Exec(Option_t *opt)
void SetOutputFile(TFile *ofile)
void AddInputFile(TString name)
void SetPrintFreq(Int_t f)
void SetSplitLevel(Int_t split)
void SetMaxEvents(Int_t n)
Handling of 3-vectors in various reference frames.
void SetVector(Double_t *v, TString f, TString u="rad")
void AddNamedSlot(TString s)
void SetSlotName(TString s, Int_t j=1)
Signal (Hit) handling of a generic device.
virtual void Reset(Int_t mode=0)
NcDevice * GetIdDevice(Int_t id, TObjArray *devs=0) const
void AddDevice(NcDevice &d)
void SetEventNumber(Int_t evt)
virtual void HeaderData()
TObjArray * GetDevices(TString classname, TObjArray *devices=0)
void SetRunNumber(Int_t run)
void SetTrackCopy(Int_t j)
void AddTrack(NcTrack &t)
void SetMainObject(TObject *obj)
void RemoveObject(TObject *obj)
NcJob(const char *name="NcJob", const char *title="")
Handling of positions (with timestamps) in various reference frames.
void SetPosition(Double_t *r, TString f, TString u="rad")
Generic handling of (extrapolated) detector signals.
Int_t GetNwaveforms() const
virtual void Reset(Int_t mode=0)
virtual void SetSignal(Double_t sig, Int_t j=1)
void SetWaveform(TH1F *waveform, Int_t j=1)
void SetMJD(Int_t mjd, Int_t sec, Int_t ns, Int_t ps=0, TString utc="U", Int_t leap=0, Double_t dut=0)
Handling of the attributes of a reconstructed particle track.
void SetBeginPoint(NcPosition &p)
void Set3Momentum(Nc3Vector &p)