Created
February 25, 2020 13:24
-
-
Save janmayer/0aa0dd18269c6d159475b8c608e169fa to your computer and use it in GitHub Desktop.
s467
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// NeuLAND Online Monitoring | |
// run: root -l -q -b neuland_online.C | |
struct EXT_STR_h101_t | |
{ | |
EXT_STR_h101_unpack_t unpack; | |
EXT_STR_h101_TPAT tpat; | |
EXT_STR_h101_SOFSCI_onion_t sci; | |
EXT_STR_h101_raw_nnp_tamex_t raw_nnp; | |
}; | |
void neuland_online() | |
{ | |
const Int_t nBarsPerPlane = 50; // number of scintillator bars per plane | |
const Int_t nPlanes = 16; // number of planes (for TCAL calibration) | |
const double distanceToTarget = 1520.; | |
const Int_t nev = -1; /* number of events to read, -1 - until CTRL+C */ | |
const Int_t trigger = -1; // 1 - onspill, 2 - offspill. -1 - all | |
const TString filename = "stream://lxlanddaq01:8000"; // time-stitched | |
// const TString filename = "/lustre/land/202002_s467/stitched/main0321_*.lmd"; | |
const TString ucesbPath = "/lynx/Lynx/land/usr/land/landexp/202002_s467/upexps/202002_s467/202002_s467"; | |
const TString usesbCall = ucesbPath + " --allow-errors --input-buffer=100Mi"; | |
// Event IO Setup | |
// ------------------------------------------- | |
EXT_STR_h101 ucesbStruct; | |
auto source = new R3BUcesbSource(filename, "RAW", usesbCall, &ucesbStruct, sizeof(ucesbStruct)); | |
source->SetMaxEvents(nev); | |
source->AddReader(new R3BUnpackReader(&ucesbStruct.unpack, offsetof(EXT_STR_h101, unpack))); | |
source->AddReader(new R3BTrloiiTpatReader((EXT_STR_h101_TPAT_t*)&ucesbStruct.tpat, offsetof(EXT_STR_h101, tpat))); | |
source->AddReader(new R3BSofSciReader((EXT_STR_h101_SOFSCI_t*)&ucesbStruct.sci, offsetof(EXT_STR_h101, sci))); | |
source->AddReader(new R3BNeulandTamexReader(&ucesbStruct.raw_nnp, offsetof(EXT_STR_h101, raw_nnp))); | |
auto run = new FairRunOnline(source); | |
run->SetRunId(999); | |
run->ActivateHttpServer(1, 60066); | |
//run->SetSink(new FairRootFileSink("online_out.root")); | |
// Parameter IO Setup | |
// ------------------------------------------- | |
auto rtdb = run->GetRuntimeDb(); | |
auto parIO = new FairParRootFileIo(false); | |
parIO->open("params_sync_s467_3.root"); | |
rtdb->setFirstInput(parIO); | |
auto parIOsofia = new FairParAsciiFileIo(); | |
parIOsofia->open("CalibParam.par", "in"); | |
rtdb->setSecondInput(parIOsofia); | |
// Tasks | |
// ------------------------------------------- | |
run->AddTask(new R3BSofSciMapped2Tcal()); | |
run->AddTask(new R3BSofiaProvideTStart()); | |
auto tcal = new R3BNeulandMapped2Cal(); | |
tcal->SetTrigger(trigger); | |
tcal->SetNofModules(nPlanes, nBarsPerPlane); | |
tcal->SetNhitmin(1); | |
run->AddTask(tcal); | |
auto nlhit = new R3BNeulandCal2Hit(); | |
nlhit->SetDistanceToTarget(distanceToTarget); | |
nlhit->SetGlobalTimeOffset(7300); | |
run->AddTask(nlhit); | |
auto r3bNeulandOnlineSpectra = new R3BNeulandOnlineSpectra(); | |
r3bNeulandOnlineSpectra->SetDistanceToTarget(distanceToTarget); | |
run->AddTask(r3bNeulandOnlineSpectra); | |
// Go! | |
// ------------------------------------------- | |
run->Init(); | |
FairLogger::GetLogger()->SetLogScreenLevel("ERROR"); | |
run->Run((nev < 0) ? nev : 0, (nev < 0) ? 0 : nev); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment