252 if (split>=0)
fSplit=split;
264 if (bsize>=0)
fBsize=bsize;
295 if (mode<0 || mode >3)
return;
312 if (mode<0 || mode >1)
return;
335 TObjString* s=
new TObjString();
354 TObjString* s=
new TObjString();
380 fOutfile=
new TFile(name.Data(),
"RECREATE",
"F2K data in IceEvent structure");
463 cout <<
" *IceF2k Exec* No data input file(s) specified." << endl;
467 Int_t ninfiles=
fInfiles->GetEntries();
470 cout <<
" *IceF2k Exec* No data input file(s) specified." << endl;
477 otree=
new TTree(
"T",
"F2K Data converted to IceEvent structures");
486 if (otree) otree->Branch(
"IceEvent",
"IceEvent",&evt,
fBsize,
fSplit);
490 Double_t me=
fPdg->GetParticle(11)->Mass();
491 fPdg->AddParticle(
"brems" ,
"brems" ,0,1,0,0,
"none",10001001,0,0);
492 fPdg->AddParticle(
"deltae" ,
"deltae" ,me,1,0,-3,
"Lepton",10001002,0,0);
493 fPdg->AddParticle(
"pairprod",
"pairprod",0,1,0,0,
"none",10001003,0,0);
494 fPdg->AddParticle(
"nucl_int",
"nucl_Int",0,1,0,0,
"none",10001004,0,0);
495 fPdg->AddParticle(
"mu_pair" ,
"mu_pair" ,0,1,0,0,
"none",10001005,0,0);
496 fPdg->AddParticle(
"hadrons" ,
"hadrons" ,0,1,0,0,
"none",10001006,0,0);
497 fPdg->AddParticle(
"fiberlaser",
"fiberlaser",0,1,0,0,
"none",10002100,0,0);
498 fPdg->AddParticle(
"n2laser" ,
"n2laser" ,0,1,0,0,
"none",10002101,0,0);
499 fPdg->AddParticle(
"yaglaser" ,
"yaglaser" ,0,1,0,0,
"none",10002201,0,0);
500 fPdg->AddParticle(
"z_primary",
"z_primary",0,1,0,0,
"none",10003000,0,0);
501 fPdg->AddParticle(
"a_primary",
"a_primary",0,1,0,0,
"none",10003500,0,0);
505 params.SetNameTitle(
"IceF2k",
"IceF2k processor parameters");
520 cout <<
" ***" << endl;
521 cout <<
" *** Start processing of job " << GetName() <<
" ***" << endl;
522 cout <<
" ***" << endl;
523 for (Int_t i=0; i<ninfiles; i++)
525 TObjString* sx=(TObjString*)
fInfiles->At(i);
527 inputfile=sx->GetString();
528 cout <<
" F2K input file : " << inputfile.Data() << endl;
530 cout <<
" Maximum number of events to be processed : " <<
fMaxevt << endl;
531 cout <<
" Print frequency : " <<
fPrintfreq << endl;
534 cout <<
" ROOT output file : " <<
fOutfile->GetName() << endl;
535 cout <<
" Output characteristics : splitlevel = " <<
fSplit <<
" buffersize = " <<
fBsize << endl;
537 cout <<
" TWR input compression level : " <<
fCompTWR << endl;
549 for (Int_t ifile=0; ifile<ninfiles; ifile++)
551 TObjString* sx=(TObjString*)
fInfiles->At(ifile);
554 inputfile=sx->GetString();
555 if (inputfile==
"")
continue;
558 fInput=rdmc_mcopen(inputfile.Data(),
"r",RDMC_DEFAULT_ASCII_F);
562 cout <<
" *IceF2k Exec* No input file found with name : " << inputfile.Data() << endl;
628 if (seldev->
GetSignal(
"Select") < 0.1) evtsel=-1;
630 if (otree && evtsel==1) otree->Fill();
669 Int_t adccal=
fHeader.is_calib.adc;
670 Int_t tdccal=
fHeader.is_calib.tdc;
671 Int_t totcal=
fHeader.is_calib.tot;
673 TF1 fadccal(
"fadccal",
"(x-[1])*[0]");
674 TF1 fadcdecal(
"fadcdecal",
"(x/[0])+[1]");
675 fadccal.SetParName(0,
"BETA-ADC");
676 fadccal.SetParName(1,
"PED-ADC");
677 fadcdecal.SetParName(0,
"BETA-ADC");
678 fadcdecal.SetParName(1,
"PED-ADC");
680 TF1 ftdccal(
"ftdccal",
"(x*[0])-[1]-([0]-1.)*32767.-[2]/sqrt([3])");
681 TF1 ftdcdecal(
"ftdcdecal",
"(x+([0]-1.)*32767.+[1]+[2]/sqrt([3]))/[0]");
682 ftdccal.SetParName(0,
"BETA-TDC");
683 ftdccal.SetParName(1,
"T0");
684 ftdccal.SetParName(2,
"ALPHA-TDC");
685 ftdccal.SetParName(3,
"ADC-SLEW");
686 ftdcdecal.SetParName(0,
"BETA-TDC");
687 ftdcdecal.SetParName(1,
"T0");
688 ftdcdecal.SetParName(2,
"ALPHA-TDC");
689 ftdcdecal.SetParName(3,
"ADC-SLEW");
691 TF1 ftotcal(
"ftotcal",
"x*[0]");
692 TF1 ftotdecal(
"ftotdecal",
"x/[0]");
693 ftotcal.SetParName(0,
"BETA-TOT");
694 ftotdecal.SetParName(0,
"BETA-TOT");
703 fOmdb->SetNameTitle(
"OMDBASE",
"The OM geometry, calib. etc... database");
708 Double_t pos[3]={0,0,0};
709 for (Int_t i=0; i<
fHeader.nch; i++)
712 dev->SetUniqueID(i+1);
729 fadccal.SetParameter(0,
fHeader.cal[i].beta_a);
730 fadccal.SetParameter(1,
fHeader.cal[i].ped);
731 fadcdecal.SetParameter(0,
fHeader.cal[i].beta_a);
732 if (!
fHeader.cal[i].beta_a) fadcdecal.SetParameter(0,1);
733 fadcdecal.SetParameter(1,
fHeader.cal[i].ped);
735 ftdccal.SetParameter(0,
fHeader.cal[i].beta_t);
736 ftdccal.SetParameter(1,
fHeader.cal[i].t_0);
737 ftdccal.SetParameter(2,
fHeader.cal[i].alpha_t);
738 ftdccal.SetParameter(3,1.e20);
739 ftdcdecal.SetParameter(0,
fHeader.cal[i].beta_t);
740 if (!
fHeader.cal[i].beta_t) ftdcdecal.SetParameter(0,1);
741 ftdcdecal.SetParameter(1,
fHeader.cal[i].t_0);
742 ftdcdecal.SetParameter(2,
fHeader.cal[i].alpha_t);
743 ftdcdecal.SetParameter(3,1.e20);
745 ftotcal.SetParameter(0,
fHeader.cal[i].beta_tot);
746 ftotdecal.SetParameter(0,
fHeader.cal[i].beta_tot);
747 if (!
fHeader.cal[i].beta_tot) ftotdecal.SetParameter(0,1);
782 fOmdb->EnterObject(i+1,1,dev);
847 fFitdefs->SetName(
"FitDefinitions");
853 for (Int_t i=0; i<
fHeader.n_fit; i++)
855 s.SetUniqueID(
fHeader.def_fit[i].id);
856 s.SetName(TString(
fHeader.def_fit[i].tag));
858 for (Int_t j=0; j<
fHeader.def_fit[i].nwords; j++)
936 for (Int_t i=0; i<
fHeader.n_trigger; i++)
938 s.SetUniqueID(
fHeader.def_trig[i].id);
939 s.SetName(TString(
fHeader.def_trig[i].tag));
941 for (Int_t j=0; j<
fHeader.def_trig[i].nwords; j++)
963 if (!evt ||
fEvent.ntrack<=0)
return;
981 for (Int_t i=0; i<
fEvent.ntrack; i++)
1014 idpdg=idf2k+10000000;
1016 else if (idf2k <= 48)
1018 idpdg=
fPdg->ConvertGeant3ToPdg(idf2k);
1022 if (idf2k==201) idpdg=12;
1023 if (idf2k==202) idpdg=14;
1024 if (idf2k==203) idpdg=16;
1025 if (idf2k==204) idpdg=-12;
1026 if (idf2k==205) idpdg=-14;
1027 if (idf2k==206) idpdg=-16;
1033 if (abs(idpdg)!=13 && abs(idpdg)!=14)
continue;
1037 if (abs(idpdg)<11 || abs(idpdg)>16)
continue;
1041 t.SetName(
fPdg->GetParticle(idpdg)->GetName());
1042 t.SetTitle(
"MC track");
1052 for (Int_t itk=1; itk<=evt->
GetNtracks (); itk++)
1061 for (Int_t j=0; j<
fEvent.ntrack; j++)
1064 if (-abs(tid) == txid) parid=
fEvent.gen[j].parent;
1067 if (parid<0)
continue;
1071 if (!tpar)
continue;
1088 if (!evt ||
fEvent.nfit<=0)
return;
1098 for (Int_t i=0; i<
fEvent.nfit; i++)
1140 idpdg=idf2k+10000000;
1142 else if (idf2k <= 48)
1144 idpdg=
fPdg->ConvertGeant3ToPdg(idf2k);
1148 if (idf2k==201) idpdg=12;
1149 if (idf2k==202) idpdg=14;
1150 if (idf2k==203) idpdg=16;
1151 if (idf2k==204) idpdg=-12;
1152 if (idf2k==205) idpdg=-14;
1153 if (idf2k==206) idpdg=-16;
1157 t.SetNameTitle(
"Sieglinde",
"RECO track");
1163 for (Int_t jval=0; jval<
fEvent.fresult[i].nval; jval++)
1214 for (Int_t i=0; i<
fEvent.nhits; i++)
1217 if (chan>maxchan)
continue;
1231 om.SetUniqueID(chan);
1253 s.SetUniqueID(
fEvent.h[i].id);
1273 if (fcal) fcal->SetParameter(3,adc);
1274 if (fdecal) fdecal->SetParameter(3,adc);
1278 if (fcal) fcal->SetParameter(3,1.e20);
1279 if (fdecal) fdecal->SetParameter(3,1.e20);
1293 if (tid == -2) sx->SetNameTitle(
"N",
"Noise");
1294 if (tid == -3) sx->SetNameTitle(
"A",
"Afterpulse");
1305 for (Int_t iwf=0; iwf<
fEvent.nwf; iwf++)
1308 if (chan<=0 || chan>maxchan)
continue;
1322 om.SetUniqueID(chan);
1330 hname=
"BASELINE-WF";
1342 histo.SetName(hname.Data());
1343 nbins=
fEvent.wf[iwf].ndigi;
1344 xlow=
fEvent.wf[iwf].t_start;
1345 xup=xlow+float(nbins)*
fEvent.wf[iwf].t_bin;
1346 histo.SetBins(nbins,xlow,xup);
1348 for (Int_t jbin=1; jbin<=
fEvent.wf[iwf].ndigi; jbin++)
1352 histo.SetBinContent(jbin,
fEvent.wf[iwf].baseline-
fEvent.wf[iwf].digi[jbin-1]);
1356 if (jbin==1) amp=
fEvent.wf[iwf].digi[0];
1357 if (jbin==2) amp=
fEvent.wf[iwf].digi[1]-histo.GetBinContent(1);
1358 if (jbin>2) amp=
fEvent.wf[iwf].digi[jbin-1]-2.*histo.GetBinContent(jbin-1)+histo.GetBinContent(jbin-2);
1359 histo.SetBinContent(jbin,-amp);
1370 for (Int_t jtk=0; jtk<rectracks->GetEntries(); jtk++)
1372 tx=(
NcTrack*)rectracks->At(jtk);
1378 if (!hypx)
continue;
1381 for (Int_t k=0; k<
fEvent.nfit_uses; k++)
1383 if (
fEvent.fit_uses[k].useid != hypx->
GetId())
continue;
1384 hid=
fEvent.fit_uses[k].hitid;
1403 if (!evt ||
fEvent.ntrig<=0)
return;
1406 trig.SetNameTitle(
"Trigger",
"Amanda/IceCube event triggers");
1412 for (Int_t i=0; i<
fEvent.ntrig; i++)
1415 nval=
fEvent.ptrig[i].nval;
1416 if (!nval)
continue;
1418 if (!tdef)
continue;
1419 trigname=tdef->GetName();
1421 s.SetName(trigname);
1422 s.SetUniqueID(
id+1);
1423 for (Int_t jval=0; jval<
fEvent.ptrig[i].nval; jval++)
Signal (Hit) handling of a generic Amanda Optical Module (AOM).
Handling of IceCube event data.
Job for conversion of F2K data into IceEvent physics event structures.
void SelectMcTracks(Int_t mode)
void SetMcToffset(Float_t toffset)
NcObjMatrix * GetOMdbase()
IceF2k(const char *name="IceF2k", const char *title="")
void AddInputFile(TString name)
mcfile * fInput
! Structure holding the input file characteristics
void SetInputFile(TString name)
void SetOutputFile(TFile *ofile)
void SetMaxEvents(Int_t n)
Array fHeader
! Structure holding the file header info
virtual void Exec(Option_t *opt)
void SetBufferSize(Int_t bsize)
void SetSplitLevel(Int_t split)
mevt fEvent
! Structure holding the actual event data (hits, tracks, etc...)
void SetPrintFreq(Int_t f)
void SetCompressedTWR(Int_t mode)
Handling of 3-vectors in various reference frames.
void SetVector(Double_t *v, TString f, TString u="rad")
TString GetSlotName(Int_t j=1) const
void SetCalFunction(TF1 *f, Int_t j=1)
void AddNamedSlot(TString s)
void SetDecalFunction(TF1 *f, Int_t j=1)
void SetSlotName(TString s, Int_t j=1)
TF1 * GetCalFunction(Int_t j=1) const
TF1 * GetDecalFunction(Int_t j=1) const
Signal (Hit) handling of a generic device.
NcSignal * GetHit(Int_t j) const
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()
NcSignal * GetIdHit(Int_t id, TString classname)
NcDevice * GetDevice(Int_t i) const
void SetRunNumber(Int_t run)
TObjArray * GetTracks(Int_t idmode=0, Int_t chmode=2, Int_t pcode=0, TObjArray *tracks=0)
Int_t GetNtracks(Int_t idmode=0, Int_t chmode=2, Int_t pcode=0)
NcTrack * GetTrack(Int_t i) const
NcTrack * GetIdTrack(Int_t id) const
void SetTrackCopy(Int_t j)
void AddTrack(NcTrack &t)
TObject * GetMainObject() const
void SetMainObject(TObject *obj)
void AddObject(TObject *obj)
void RemoveObject(TObject *obj)
NcJob(const char *name="NcJob", const char *title="")
Handling of a matrix structure of objects.
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)
virtual Float_t GetSignal(Int_t j=1, Int_t mode=0) const
void AddTrack(NcTrack &t, Int_t mode=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.
NcTrack * GetTrackHypothesis(Int_t j=0) const
void SetCharge(Float_t q)
void SetBeginPoint(NcPosition &p)
void AddTrackHypothesis(NcTrack &t)
void SetEndPoint(NcPosition &p)
void SetMass(Double_t m, Double_t dm=0)
void SetParticleCode(Int_t code)
void Set3Momentum(Nc3Vector &p)
void SetFitDetails(TObject *obj)
Int_t GetNhypotheses() const
void SetParentTrack(NcTrack *t)