#include "hdst.h" #include "htrbnetdef.h" //------- detectors ------------------- #include "hspectrometer.h" #include "hrichdetector.h" #include "hmdcdetector.h" #include "htofdetector.h" #include "hrpcdetector.h" #include "hshowerdetector.h" #include "hemcdetector.h" #include "htboxdetector.h" #include "hstart2detector.h" #include "hwalldetector.h" #include "hpiontrackerdetector.h" #include "hstsdetector.h" #include "hfrpcdetector.h" #include "hitofdetector.h" #include "frpcdef.h" #include "stsdef.h" //------------------------------------- //--------- data source --------------- #include "hldsource.h" #include "hldfilesource.h" #include "hldgrepfilesource.h" #include "hldremotesource.h" #include "hldstacksource.h" #include "hrootsource.h" #include "hgeantmergesource.h" //------------------------------------- //-------- unpackers ----------------- #include "hmdcunpacker.h" #include "hmdctrbcunpacker.h" #include "hshowerunpacker.h" #include "hrichunpacker.h" #include "hrich700trb3unpacker.h" #include "hwalltrb2unpacker.h" #include "hwalltrb3unpacker.h" #include "hrpctrb2unpacker.h" #include "hrpctrb3unpacker.h" #include "htoftrb2unpacker.h" #include "htoftrb3unpacker.h" #include "hstart2trb2unpacker.h" #include "hstart2trb3unpacker.h" #include "hlatchunpacker.h" #include "htboxunpacker.h" #include "hpiontrackertrb3unpacker.h" #include "hststrb3unpacker.h" #include "hfrpctrb3unpacker.h" #include "hemctrb3unpacker.h" #include "hitoftrb3unpacker.h" //------------------------------------- //-------- parameters ----------------- #include "hades.h" #include "hruntimedb.h" #ifdef ORACLE_SUPPORT #include "hparora2io.h" #endif #include "hparasciifileio.h" #include "hparrootfileio.h" //------------------------------------- //----------------------------------- // set Objects with custom streamers splitable // datastruct #include "hcategory.h" #include "hindextable.h" #include "hlinearcategory.h" #include "hlocateddataobject.h" #include "hmatrixcategory.h" #include "hades.h" #include "hevent.h" #include "heventheader.h" #include "hpartialevent.h" #include "hrecevent.h" #include "hspectrometer.h" //data objects #include "hgeantkine.h" #include "hgeantmdc.h" #include "hgeantrich.h" #include "hgeantrpc.h" #include "hgeanttof.h" #include "hvirtualcand.h" #include "hvirtualcandsim.h" #include "hmdcseg.h" #include "hmdcclusfit.h" #include "hmdcwirefit.h" #include "hmdcslopes.h" #include "hbasetrack.h" #include "hmetamatch2.h" #include "hparticlebtring.h" #include "hkaloutput.h" #include "hparticlecand.h" #include "hparticlecandsim.h" #include "hparticleevtinfo.h" #include "hpiontrackertrack.h" #include "hrichcal.h" #include "hrichcalsim.h" #include "hrichhit.h" #include "hstart2cal.h" #include "hstart2hit.h" #include "hstart2raw.h" #include "htofcluster.h" #include "htofhit.h" #include "hforwardcand.h" #include "hforwardcandsim.h" #include "hemcneutralcand.h" #include "hemcneutralcandsim.h" //----------------------------------- #include "TObjString.h" #include #include using namespace std; ClassImp(HDst) void HDst::fillDetectorNames(TString names,vector& vdetnames) { vdetnames.clear(); names.ReplaceAll(" ",""); TObjArray* a =names.Tokenize(","); for(Int_t i=0;iGetEntries();i++){ vdetnames.push_back(((TObjString*)a->At(i))->GetString()); } if(a){ a->Delete(); delete a ; } } Bool_t HDst::detector(TString n,vector& vdetnames) { return (find(vdetnames.begin(),vdetnames.end(),n) == vdetnames.end())? kFALSE : kTRUE; } void HDst::setupSpectrometer(TString beamtime,Int_t mdcsetup[6][4],TString detectors) { // beamtime aug11,aug11_3sec,apr12,jul14,aug14,aug18,mar19 // Int_t mdcset[6][4] setup mdc. If not used put NULL (default). // if not NULL it will overwrite settings given by beamtime // detectors (default)= rich,mdc,tof,rpc,shower,wall,tbox,start beamtime.ToLower(); detectors.ToLower(); vector l; fillDetectorNames(detectors,l); ::Info("setupSpectrometer()", "\n----------- setting up HADES spectrometer ----------------"); if(beamtime.CompareTo("may14")==0) beamtime = "jul14"; if(beamtime.CompareTo("aug14")==0) beamtime = "jul14"; if (beamtime.CompareTo("aug11") ==0); else if(beamtime.CompareTo("aug11_3sec")==0); else if(beamtime.CompareTo("apr12") ==0); else if(beamtime.CompareTo("jul14") ==0); else if(beamtime.CompareTo("aug18") ==0); else if(beamtime.CompareTo("mar19") ==0); else if(beamtime.CompareTo("feb21") ==0); else if(beamtime.CompareTo("feb22") ==0); else if(beamtime.CompareTo("feb24") ==0); else if(beamtime.CompareTo("fwdet") ==0); else if(beamtime.CompareTo("apr25") ==0); else { ::Error("","Beam time = '%s' not supported !",beamtime.Data()); exit(1); } ::Info("setupSpectrometer()", "Using %s setup",beamtime.Data()); HDst::setSplitable(); Int_t mdcMods_aug11[6][4]={ {1,1,1,1}, {1,1,0,1}, {1,1,1,1}, {1,1,1,1}, {1,1,1,1}, {1,1,1,1} }; Int_t mdcMods_aug11_3sec[6][4]={ {0,0,0,0}, {0,0,0,0}, {1,1,1,1}, {0,0,0,0}, {1,1,1,1}, {1,1,1,1} }; Int_t mdcMods_apr12[6][4]={ {1,1,1,1}, {1,1,1,1}, {1,1,1,1}, {1,1,1,1}, {1,1,1,1}, {1,1,1,1} }; Int_t mdcMods[6][4]; ::Info("", "setting up MDC modules"); if(mdcsetup) ::Info("", "settings will be taken by input array"); else ::Info("", "settings will be taken by %s",beamtime.Data()); for(Int_t s=0;s<6;s++){ cout<<" sec "<getSetup(); if(detector("tbox",l)){ ::Info("","Adding TBox"); spec->addDetector(new HTBoxDetector); spec->getDetector("TBox")->setModules(-1,nTrigMods); } if(detector("start",l)) { ::Info("","Adding START"); spec->addDetector(new HStart2Detector); if( beamtime.CompareTo("aug11") ==0 || beamtime.CompareTo("aug11_3sec") ==0 ) { spec->getDetector("Start")->setModules(-1,nStartMods); } else if (beamtime.CompareTo("apr12") ==0) { spec->getDetector("Start")->setModules(-1,nStartModsApr12); } else if (beamtime.CompareTo("jul14") ==0) { spec->getDetector("Start")->setModules(-1,nStartModsJul14); } else if (beamtime.CompareTo("aug18") ==0) { spec->getDetector("Start")->setModules(-1,nStartModsAug18); } else if (beamtime.CompareTo("mar19") ==0) { spec->getDetector("Start")->setModules(-1,nStartModsMar19); } else if (beamtime.CompareTo("feb21") ==0) { spec->getDetector("Start")->setModules(-1,nStartModsFeb21); } else if (beamtime.CompareTo("feb22") ==0) { spec->getDetector("Start")->setModules(-1,nStartModsFeb22); } else if (beamtime.CompareTo("feb24") ==0) { // TODO spec->getDetector("Start")->setModules(-1,nStartModsMar19); } else if (beamtime.CompareTo("apr25") ==0) { // TODO spec->getDetector("Start")->setModules(-1,nStartModsMar19); } else if (beamtime.CompareTo("fwdet") ==0) { spec->getDetector("Start")->setModules(-1,nStartModsJul14); } } if(detector("wall",l)) { ::Info("","Adding WALL"); spec->addDetector(new HWallDetector); spec->getDetector("Wall")->setModules(-1,wallMods); } if(detector("piontracker",l)) { ::Info("","Adding PionTracker"); spec->addDetector(new HPionTrackerDetector); spec->getDetector("PionTracker")->setModules(-1,pionTrackerMods); } if(detector("sts",l)) { ::Info("","Adding STS"); spec->addDetector(new HStsDetector); for (int i = 0; i < STS_MAX_LAYERS; ++i) spec->getDetector("Sts")->setModules(i,stsMods[i]); } if(detector("frpc",l)) { ::Info("","Adding FRPC"); spec->addDetector(new HFRpcDetector); for (int i = 0; i < FRPC_MAX_SECTORS; ++i) spec->getDetector("FRpc")->setModules(i,frpcMods[i]); } if(detector("rich",l)) {spec->addDetector(new HRichDetector); ::Info("","Adding RICH"); } if(detector("mdc",l)) {spec->addDetector(new HMdcDetector); ::Info("","Adding MDC"); } if(detector("tof",l)) {spec->addDetector(new HTofDetector); ::Info("","Adding TOF"); } if(detector("rpc",l)) {spec->addDetector(new HRpcDetector); ::Info("","Adding RPC"); } if(detector("shower",l)){spec->addDetector(new HShowerDetector); ::Info("","Adding SHOWER");} if(detector("emc",l)) {spec->addDetector(new HEmcDetector); ::Info("","Adding EMC");} if(detector("itof",l)) {spec->addDetector(new HiTofDetector); ::Info("","Adding iTOF");} for (Int_t is=0; is<6; is++) { if(detector("rich",l)) spec->getDetector("Rich") ->setModules(is,richMods); if(detector("mdc",l)) spec->getDetector("Mdc") ->setModules(is,mdcMods[is]); if(detector("tof",l)) spec->getDetector("Tof") ->setModules(is,tofMods); if(detector("rpc",l)) spec->getDetector("Rpc") ->setModules(is,rpcMods); if(detector("shower",l))spec->getDetector("Shower")->setModules(is,showerMods); if(detector("emc",l)) spec->getDetector("Emc") ->setModules(is,emcMods); if(detector("itof",l)) spec->getDetector("iTof") ->setModules(is,iTofMods); } } void HDst::setupParameterSources(TString parsource,TString asciiParFile,TString rootParFile,TString histDate) { // parsource = oracle,ascii,root (order matters) // if source is "ascii" a ascii param file has to provided // if source is "root" a root param file has to provided // The histDate paramter (default "now") is used wit the oracle source parsource.ToLower(); parsource.ReplaceAll(" ",""); ::Info("setupParameterSources()", "\n----------- setting up parameter sources ----------------"); Bool_t useOra = kFALSE; Bool_t useAscii = kFALSE; Bool_t useRoot = kFALSE; if(parsource.Contains("oracle")) useOra = kTRUE; if(parsource.Contains("ascii")) useAscii = kTRUE; if(parsource.Contains("root")) useRoot = kTRUE; if(useAscii && asciiParFile == "") { ::Error( "","Ascii source selected, but ascii file empty!"); exit(1); } if(useRoot && rootParFile == "") { ::Error( "","Root source selected, but root file empty!"); exit(1); } if(useOra && useRoot && useAscii) { ::Error( "","Root , Ascii and Ora cannot be active at the same time (only 2 of them)!"); exit(1); } TObjArray* ar = parsource.Tokenize(","); if(ar){ Int_t n = ar->GetEntries(); if(n > 2 || n == 0){ ::Error( "","To many ( > 2) or no param source specified !"); exit(1); } HRuntimeDb *rtdb = gHades->getRuntimeDb(); for(Int_t i = 0; i < n; i ++){ TString parsrc = ((TObjString*)ar->At(i))->GetString(); if(parsrc == "ascii"){ ::Info("", "Add ASCII as source %i reading from : %s",i+1,asciiParFile.Data()); HParAsciiFileIo *input = new HParAsciiFileIo; input->open((Text_t*)asciiParFile.Data(),"in"); if(i == 0) rtdb->setFirstInput(input); else rtdb->setSecondInput(input); } else if(parsrc == "root"){ ::Info("", "Add ROOT as source %i reading from : %s",i+1,rootParFile.Data()); HParRootFileIo *input=new HParRootFileIo; input->open((Text_t*)rootParFile.Data(),"READ"); if(i == 0) rtdb->setFirstInput(input); else rtdb->setSecondInput(input); } else if(parsrc == "oracle"){ #ifdef ORACLE_SUPPORT ::Info("", "Add ORACLE as source %i histdate = %s",i+1,histDate.Data()); HParOra2Io *ora=new HParOra2Io() ; ora->open(); if(histDate.CompareTo("now")==0 || histDate.Contains("-")){ ora->setHistoryDate(histDate.Data()); } else { ora->setParamRelease(histDate.Data()); } if(i == 0) rtdb->setFirstInput(ora); else rtdb->setSecondInput(ora); #else ::Error( "","ORCALE source specified but not supported !"); exit(1); #endif } } ar->Delete(); delete ar; } } void HDst::setDataSource(Int_t sourceType, TString inDir, TString inFile, Int_t refId, TString eventbuilder ) { // datasource 0 = hld, 1 = hldgrep 2 = hldremote, 3 root 4 geantmerge 5 hldstack(Processor task) // like "lxhadeb02.gsi.de" needed by dataosoure = 2 // inputDir needed by dataosoure = 1,2 // inputFile needed by dataosoure = 1,3,4 // inputDir should be empty if not used (dataosoure = 0,3) // inputFile can contain path if inputDir is empty // for datasource 4 inputFile is a comma seprated list // "file1_with_path,file2_with_path,file3_with_path" ::Info("setDataSource()","\n----------- setting up data sources ---------------------"); if( sourceType == 0 ){ ::Info("", "Add HldFileSource"); HldFileSource* source = new HldFileSource; if(inDir !="") source->setDirectory((Text_t*) inDir.Data()); if(inFile.Contains(",")) { // multiple file input TObjArray* ar = 0; if(inFile.Contains(",")) { ar = inFile.Tokenize(","); if(ar) { for(Int_t i=0;iGetEntries();i++) { TString file = ((TObjString*)ar->At(i))->GetString(); ::Info("", "%i : Add file %s",i,file.Data()); source->addFile((Text_t*) file.Data(),refId); } ar->Delete(); delete ar; } } } else { source->addFile((Text_t*) inFile.Data(),refId); } gHades->setDataSource(source); } else if ( sourceType == 1 ){ ::Info("", "Add HldGrepFileSource"); Int_t GrepInterval = 5 ; // look for new file each n seconds Int_t GrepTimeOffset = 10; // at least n seconds old Int_t GrepFileOffset = 0; // latest - GrepFileOffset file (minimum 0) HldGrepFileSource* source = new HldGrepFileSource(inDir,"Grep",GrepInterval,refId,GrepTimeOffset,GrepFileOffset); gHades->setDataSource(source); } else if ( sourceType == 2 ){ ::Info("", "Add HldRemoteSource"); HldRemoteSource* source = new HldRemoteSource(eventbuilder.Data()); source->setRefId(refId); gHades->setDataSource(source); } else if ( sourceType == 3 ){ ::Info("", "Add HRootSource"); HRootSource* source = new HRootSource(); if(inDir !="") source->setDirectory((Text_t*) inDir.Data()); if(inFile.Contains(",")) { // multiple file input TObjArray* ar = 0; if(inFile.Contains(",")){ ar = inFile.Tokenize(","); if(ar) { for(Int_t i=0;iGetEntries();i++){ TString file = ((TObjString*)ar->At(i))->GetString(); ::Info("", "%i : Add file %s",i,file.Data()); source->addFile((Text_t*) file.Data()); } ar->Delete(); delete ar; } } } else { source->addFile((Text_t*) inFile.Data()); } source->setGlobalRefId(refId); gHades->setDataSource(source); } else if ( sourceType == 4 ){ ::Info("", "Add HGeantMergeSource"); HGeantMergeSource* source = new HGeantMergeSource(); source->addMultFiles(inFile); source->setGlobalRefId(refId); gHades->setDataSource(source); } else if( sourceType == 5 ){ ::Info("", "Add HldStackSource"); HldStackSource* source = new HldStackSource; gHades->setDataSource(source); } else { ::Error("","Unknown source type = %i !",sourceType); exit(1); } } void HDst::setSecondDataSource(TString inDir, TString inFile, Int_t refId ) { // second datasource is a root source (used for embedding) // inputDir should be empty if not used // inputFile can contain path if inputDir is empty ::Info("setDataSource()","\n----------- setting up data sources ---------------------"); ::Info("", "Add second DataSource"); HRootSource* source = new HRootSource(kTRUE,kTRUE); if(inDir !="") source->setDirectory((Text_t*) inDir.Data()); source->addFile((Text_t*) inFile.Data()); source->setGlobalRefId(refId); gHades->setSecondDataSource(source); } void HDst::setupUnpackers(TString beamtime,TString detectors,Bool_t correctINL) { // beamtime aug11 apr12 jul14 aug14 aug18 mar19 // detectors (default)= rich,mdc,tof,rpc,shower,wall,tbox,latch,start // The data source has to be set before! ::Info("setupUnpackers()", "\n----------- setting up unpackers ---------------------"); beamtime.ToLower(); detectors.ToLower(); vector l; fillDetectorNames(detectors,l); if(beamtime.CompareTo("may14")==0) beamtime = "jul14"; if(beamtime.CompareTo("aug14")==0) beamtime = "jul14"; if (beamtime.CompareTo("aug11") ==0); else if(beamtime.CompareTo("apr12") ==0); else if(beamtime.CompareTo("jul14") ==0); else if(beamtime.CompareTo("aug18") ==0); else if(beamtime.CompareTo("mar19") ==0); else if(beamtime.CompareTo("feb21") ==0); else if(beamtime.CompareTo("feb22") ==0); else if(beamtime.CompareTo("feb24") ==0); else if(beamtime.CompareTo("fwdet") ==0); else if(beamtime.CompareTo("apr25") ==0); else { ::Error("","Beam time = %s not supported !",beamtime.Data()); exit(1); } //Data source HldSource *source = (HldSource *)gHades->getDataSource(); if(source == NULL) { ::Error( "","Datasource source not set !"); exit(1); } TString classname = source->ClassName(); if(classname == "HRootSource") { ::Error( "","Datasource is HRootSource , not compatibel with unpackers !"); exit(1); } if(beamtime == "aug11") { ::Info("", "Using aug11 setup"); Int_t mdcUnpackers [12] = {0x1100,0x1110,0x1120,0x1130,0x1140,0x1150,0x1000,0x1010,0x1020,0x1030,0x1040,0x1050}; Int_t rpcUnpackers [2] = {0x8400,0x8410}; // Int_t startUnpackers [1] = {0x8800}; // Int_t tofUnpackers [1] = {0x8600}; // Int_t wallUnpackers [1] = {0x8700}; // Int_t showerUnpackers[6] = {0x3200,0x3210,0x3220,0x3230,0x3240,0x3250}; // Int_t richUnpackers [3] = {0x8300,0x8310,0x8320}; if(detector("wall",l)) { ::Info("", "Adding WALL unpackers"); for(UInt_t i=0; i<(sizeof(wallUnpackers)/sizeof(Int_t)); i++) { cout<setQuietMode(); wallUnpacker->removeTimeRef(); source->addUnpacker( wallUnpacker); } cout<addUnpacker( new HLatchUnpacker(startUnpackers[0]) ); ::Info("", "Adding LATCH unpacker");} if(detector("tbox",l)) {source->addUnpacker( new HTBoxUnpacker(startUnpackers[0]) ); ::Info("", "Adding TBOX unpacker");} if(detector("rich",l)){ ::Info("", "Adding RICH unpackers"); for(UInt_t i=0; i<(sizeof(richUnpackers)/sizeof(Int_t)); i++){ cout<addUnpacker( new HRichUnpacker(richUnpackers[i]) ); } cout<setQuietMode(kTRUE,kFALSE); mdc_unpacker->setFillDataWord(kFALSE); //mdc_unpacker->setFillOepStatus(kTRUE); mdc_unpacker->setPersistencyDataword(kTRUE); mdc_unpacker->setPersistencyOepStatusData(kFALSE); source->addUnpacker( (HMdcUnpacker*)mdc_unpacker ); } cout<addUnpacker( new HShowerUnpacker(showerUnpackers[i]) ); } cout<setDebugFlag(0); //tofUnp->setQuietMode(); if(correctINL)tofUnp->setcorrectINL(); tofUnp->removeTimeRef(); source->addUnpacker( tofUnp ); } cout<setDebugFlag(0); if(correctINL)startUnp->setcorrectINL(); //startUnp->setQuietMode(); source->addUnpacker( startUnp ); } cout<setQuietMode(); rpcTrb2Unpacker->setDebugFlag(0); if(correctINL)rpcTrb2Unpacker->setcorrectINL(); source->addUnpacker(rpcTrb2Unpacker); } } cout<setQuietMode(); wallUnpacker->removeTimeRef(); source->addUnpacker( wallUnpacker); } cout<addUnpacker( new HLatchUnpacker(startUnpackers[0]) ); ::Info("", "Adding LATCH unpacker");} if(detector("tbox",l)) {source->addUnpacker( new HTBoxUnpacker(startUnpackers[0]) ); ::Info("", "Adding TBOX unpacker");} if(detector("rich",l)){ ::Info("", "Adding RICH unpackers"); for(UInt_t i=0; i<(sizeof(richUnpackers)/sizeof(Int_t)); i++){ cout<addUnpacker( new HRichUnpacker(richUnpackers[i]) ); } cout<setQuietMode(kTRUE,kFALSE); mdc_unpacker->setFillDataWord(kFALSE); mdc_unpacker->setFillOepStatus(kTRUE); mdc_unpacker->setPersistencyDataword(kTRUE); mdc_unpacker->setPersistencyOepStatusData(kTRUE); source->addUnpacker( (HMdcUnpacker*)mdc_unpacker ); } cout<addUnpacker( new HShowerUnpacker(showerUnpackers[i]) ); } cout<setDebugFlag(0); //tofUnp->setQuietMode(); if(correctINL)tofUnp->setcorrectINL(); tofUnp->removeTimeRef(); source->addUnpacker( tofUnp ); } cout<setDebugFlag(0); if(correctINL)startUnp->setcorrectINL(); //startUnp->setQuietMode(); //startUnp->disableTimeRef(); // new since apr12 , only for cosmics source->addUnpacker( startUnp ); } cout<setQuietMode(); rpcTrb2Unpacker->setDebugFlag(0); if(correctINL)rpcTrb2Unpacker->setcorrectINL(); source->addUnpacker(rpcTrb2Unpacker); } } cout<setQuietMode(); wallUnpacker->removeTimeRef(); source->addUnpacker( wallUnpacker); } cout<addUnpacker( new HLatchUnpacker(startUnpackers[0]) ); ::Info("", "Adding LATCH unpacker");} if(detector("tbox",l)) {source->addUnpacker( new HTBoxUnpacker(startUnpackers[0]) ); ::Info("", "Adding TBOX unpacker");} if(detector("rich",l)){ ::Info("", "Adding RICH unpackers"); for(UInt_t i=0; i<(sizeof(richUnpackers)/sizeof(Int_t)); i++){ cout<addUnpacker( new HRichUnpacker(richUnpackers[i]) ); } cout<setQuietMode(kTRUE,kFALSE); mdc_unpacker->setFillDataWord(kFALSE); mdc_unpacker->setFillOepStatus(kTRUE); mdc_unpacker->setPersistencyDataword(kTRUE); mdc_unpacker->setPersistencyOepStatusData(kFALSE); source->addUnpacker( (HMdcUnpacker*)mdc_unpacker ); } cout<addUnpacker( new HShowerUnpacker(showerUnpackers[i]) ); } cout<setDebugFlag(0); //tofUnp->setQuietMode(); if(correctINL)tofUnp->setcorrectINL(); tofUnp->removeTimeRef(); source->addUnpacker( tofUnp ); } cout<ids; for(UInt_t i=0; i<(sizeof(startUnpackersTrb3)/sizeof(Int_t)); i++){ cout<setDebugFlag(0); startUnp->setQuietMode(); startUnp->setCTSId(0x8000); source->addUnpacker( startUnp ); } if(detector("piontracker",l)){ ::Info("", "Adding PionTracker unpackers"); for(UInt_t i=0; i<(sizeof(pionTrackerUnpackers)/sizeof(Int_t)); i++){ cout<setDebugFlag(0); pionTrackerUnp->setQuietMode(); source->addUnpacker( pionTrackerUnp ); } cout<setQuietMode(); rpcTrb2Unpacker->setDebugFlag(0); if(correctINL)rpcTrb2Unpacker->setcorrectINL(); source->addUnpacker(rpcTrb2Unpacker); } } cout<setQuietMode(); wallUnpacker->removeTimeRef(); source->addUnpacker( wallUnpacker); } cout<addUnpacker( new HLatchUnpacker(startUnpackers[0]) ); ::Info("", "Adding LATCH unpacker");} if(detector("tbox",l)) {source->addUnpacker( new HTBoxUnpacker(startUnpackers[0]) ); ::Info("", "Adding TBOX unpacker");} if(detector("rich",l)){ ::Info("", "Adding RICH unpackers"); vectorids; for(UInt_t i=0; i<(sizeof(richUnpackers)/sizeof(Int_t)); i++){ cout<setMinAddress(Trbnet::kRICHTrb3MinTrbnetAddress); // set this for auto registering TDCs, otherwise tdc list will be used from lookup table //unp->setMaxAddress(Trbnet::kRICHTrb3MaxTrbnetAddress); // set this for auto registering TDCs, otherwise tdc list will be used from lookup table unp->setDebugFlag(0); unp->setQuietMode(); source->addUnpacker( unp ); } if(detector("mdc",l)){ ::Info("", "Adding MDC unpackers"); for(UInt_t i=0; i<(sizeof(mdcUnpackers)/sizeof(Int_t)); i++) { cout<setQuietMode(kTRUE,kFALSE); mdc_unpacker->setFillDataWord(kFALSE); mdc_unpacker->setFillOepStatus(kTRUE); mdc_unpacker->setPersistencyDataword(kTRUE); mdc_unpacker->setPersistencyOepStatusData(kFALSE); source->addUnpacker( (HMdcUnpacker*)mdc_unpacker ); } cout<setDebugFlag(0); //tofUnp->setQuietMode(); if(correctINL)tofUnp->setcorrectINL(); tofUnp->removeTimeRef(); source->addUnpacker( tofUnp ); } cout<ids; for(UInt_t i=0; i<(sizeof(startUnpackersTrb3)/sizeof(Int_t)); i++){ cout<setDebugFlag(0); startUnp->setQuietMode(); startUnp->setCTSId(0x8000); //startUnp->setMinAddress(Trbnet::kStartTrb3MinTrbnetAddress); // set this for auto registering TDCs, otherwise tdc list will be used from lookup table //startUnp->setMaxAddress(Trbnet::kStartTrb3MaxTrbnetAddress); // set this for auto registering TDCs, otherwise tdc list will be used from lookup table source->addUnpacker( startUnp ); } if(detector("piontracker",l)){ ::Info("", "Adding PionTracker unpackers"); for(UInt_t i=0; i<(sizeof(pionTrackerUnpackers)/sizeof(Int_t)); i++){ cout<setDebugFlag(0); pionTrackerUnp->setQuietMode(); source->addUnpacker( pionTrackerUnp ); } cout<setQuietMode(); rpcTrb2Unpacker->setDebugFlag(0); if(correctINL)rpcTrb2Unpacker->setcorrectINL(); source->addUnpacker(rpcTrb2Unpacker); } cout<ids; for(UInt_t i=0; i<(sizeof(emcUnpackers)/sizeof(Int_t)); i++){ cout<setMinAddress(Trbnet::kEmcTrb3MinTrbnetAddress); // set this for auto registering TDCs, otherwise tdc list will be used from lookup table //emcUnp->setMaxAddress(Trbnet::kEmcTrb3MaxTrbnetAddress); // set this for auto registering TDCs, otherwise tdc list will be used from lookup table emcUnp->setDebugFlag(0); emcUnp->setQuietMode(); source->addUnpacker( emcUnp ); } } else if(beamtime == "feb21" || beamtime == "fwdet"){ if(beamtime == "feb21")::Info("", "Using feb21 setup"); if(beamtime == "fwdet")::Info("", "Using fwdet setup"); Int_t mdcUnpackers [12] = {0x1100,0x1110,0x1120,0x1130,0x1140,0x1150,0x1000,0x1010,0x1020,0x1030,0x1040,0x1050}; //Int_t rpcUnpackers [3] = {0x8400,0x8410,0x8420}; Int_t rpcUnpackers [6] = {0x84c0, 0x84c1, 0x84c2, 0x84c3, 0x84c4, 0x84c5}; Int_t startUnpackers [1] = {0x8800}; // CTS-Hub Int_t startUnpackersTrb3 [3] = {0x8880,0x8890,0x8d00}; //start+veto //Int_t tofUnpackers [1] = {0x8600}; // Int_t tofUnpackers [6] = {0x86c0, 0x86c1,0x86c2, 0x86c3, 0x86c4, 0x86c5}; // feb21 trb3 Int_t richUnpackers [12] = {0x83c0,0x83c1,0x83c2,0x83c3,0x83c4,0x83c5,0x83c6,0x83c7,0x83c8,0x83c9,0x83ca,0x83cb}; Int_t emcUnpackers [6] = {0x8A00,0x8A01,0x8A02,0x8A03,0x8A04,0x8A05}; Int_t fwDetStrawUnpackers[10] = {0x8B00,0x8B01,0x8B02,0x8B03,0x8B10,0x8B11,0x8B12,0x8B13,0x8B14,0x8B15}; Int_t fwDetRpcUnpackers [2] = {0x8C00,0x8C10}; if(detector("latch",l)) {source->addUnpacker( new HLatchUnpacker(startUnpackers[0]) ); ::Info("", "Adding LATCH unpacker");} if(detector("tbox",l)) {source->addUnpacker( new HTBoxUnpacker(startUnpackers[0]) ); ::Info("", "Adding TBOX unpacker");} if(detector("rich",l)){ ::Info("", "Adding RICH unpackers"); vectorids; for(UInt_t i=0; i<(sizeof(richUnpackers)/sizeof(Int_t)); i++){ cout<setMinAddress(Trbnet::kRICHTrb3MinTrbnetAddress); // set this for auto registering TDCs, otherwise tdc list will be used from lookup table //unp->setMaxAddress(Trbnet::kRICHTrb3MaxTrbnetAddress); // set this for auto registering TDCs, otherwise tdc list will be used from lookup table unp->setDebugFlag(0); unp->setQuietMode(); unp->shiftTimes(1100.); source->addUnpacker( unp ); } if(detector("mdc",l)){ ::Info("", "Adding MDC unpackers"); for(UInt_t i=0; i<(sizeof(mdcUnpackers)/sizeof(Int_t)); i++) { cout<setQuietMode(kTRUE,kFALSE); mdc_unpacker->setFillDataWord(kFALSE); mdc_unpacker->setFillOepStatus(kTRUE); mdc_unpacker->setPersistencyDataword(kTRUE); mdc_unpacker->setPersistencyOepStatusData(kFALSE); source->addUnpacker( (HMdcUnpacker*)mdc_unpacker ); } cout<ids; ids.clear(); for(UInt_t i=0; i<(sizeof(tofUnpackers)/sizeof(Int_t)); i++){ ids.push_back(tofUnpackers[i]); cout<disableTimeRef(kTRUE); tofUnp->setDebugFlag(0); tofUnp->setQuietMode(); tofUnp->shiftTimes(1100.); source->addUnpacker( tofUnp ); } if(detector("start",l)){ ::Info("", "Adding START unpackers"); vectorids; for(UInt_t i=0; i<(sizeof(startUnpackersTrb3)/sizeof(Int_t)); i++){ cout<setDebugFlag(0); startUnp->setQuietMode(); startUnp->setCTSId(0x8000); //startUnp->setMinAddress(Trbnet::kStartTrb3MinTrbnetAddress); // set this for auto registering TDCs, otherwise tdc list will be used from lookup table //startUnp->setMaxAddress(Trbnet::kStartTrb3MaxTrbnetAddress); // set this for auto registering TDCs, otherwise tdc list will be used from lookup table startUnp->shiftTimes(1100.); source->addUnpacker( startUnp ); } if(detector("rpc",l)){ ::Info("", "Adding RPC unpackers"); vectorids; ids.clear(); for(UInt_t i=0; i<(sizeof(rpcUnpackers)/sizeof(Int_t)); i++){ cout<setQuietMode(); rpcTrb3Unpacker->setDebugFlag(0); rpcTrb3Unpacker->storeSpareChannelsData(); rpcTrb3Unpacker->shiftTimes(1100.); //rpcTrb3Unpacker->setMinAddress(Trbnet::kRpcTrb3MinTrbnetAddress); // set this for auto registering TDCs, otherwise tdc list will be used from lookup table //rpcTrb3Unpacker->setMaxAddress(Trbnet::kRpcTrb3MaxTrbnetAddress); // set this for auto registering TDCs, otherwise tdc list will be used from lookup table source->addUnpacker(rpcTrb3Unpacker); } if(detector("emc",l)) { ::Info("", "Adding Emc unpackers"); vectorids; for(UInt_t i=0; i<(sizeof(emcUnpackers)/sizeof(Int_t)); i++){ cout<setMinAddress(Trbnet::kEmcTrb3MinTrbnetAddress); // set this for auto registering TDCs, otherwise tdc list will be used from lookup table //emcUnp->setMaxAddress(Trbnet::kEmcTrb3MaxTrbnetAddress); // set this for auto registering TDCs, otherwise tdc list will be used from lookup table emcUnp->setDebugFlag(0); emcUnp->setQuietMode(); emcUnp->shiftTimes(1100.); source->addUnpacker( emcUnp ); } if(detector("sts",l)) { ::Info("", "Adding Sts unpackers"); vectorids; for(UInt_t i=0; i<(sizeof(fwDetStrawUnpackers)/sizeof(Int_t)); i++){ cout<setMinAddress(Trbnet::kStsTrb3MinTrbnetAddress); // set this for auto registering TDCs, otherwise tdc list will be used from lookup table //fwdetStrawUnp->setMaxAddress(Trbnet::kStsTrb3MaxTrbnetAddress); // set this for auto registering TDCs, otherwise tdc list will be used from lookup table fwdetStrawUnp->setDebugFlag(0); fwdetStrawUnp->setQuietMode(); fwdetStrawUnp->shiftTimes(1100.); source->addUnpacker( fwdetStrawUnp ); } if(detector("frpc",l)) { ::Info("", "Adding FRpc unpackers"); vectorids; for(UInt_t i=0; i<(sizeof(fwDetRpcUnpackers)/sizeof(Int_t)); i++){ cout<setMinAddress(Trbnet::kFRpcTrb3MinTrbnetAddress); // set this for auto registering TDCs, otherwise tdc list will be used from lookup table //fwdetRpcUnp->setMaxAddress(Trbnet::kFRpcTrb3MaxTrbnetAddress); // set this for auto registering TDCs, otherwise tdc list will be used from lookup table fwdetRpcUnp->setDebugFlag(0); fwdetRpcUnp->setQuietMode(); fwdetRpcUnp->shiftTimes(1100.); source->addUnpacker( fwdetRpcUnp ); } } else if(beamtime == "feb22"){ ::Info("", "Using feb22 setup"); Int_t mdcUnpackers [12] = {0x1100,0x1110,0x1120,0x1130,0x1140,0x1150,0x1000,0x1010,0x1020,0x1030,0x1040,0x1050}; Int_t rpcUnpackers [6] = {0x84c0, 0x84c1, 0x84c2, 0x84c3, 0x84c4, 0x84c5}; Int_t startUnpackers [1] = {0x8800}; // CTS-Hub Int_t startUnpackersTrb3 [2] = {0x8880,0x8890}; //start+veto Int_t tofUnpackers [6] = {0x86c0, 0x86c1,0x86c2, 0x86c3, 0x86c4, 0x86c5}; // feb21 trb3 Int_t richUnpackers [12] = {0x83c0,0x83c1,0x83c2,0x83c3,0x83c4,0x83c5,0x83c6,0x83c7,0x83c8,0x83c9,0x83ca,0x83cb}; Int_t emcUnpackers [6] = {0x8A00,0x8A01,0x8A02,0x8A03,0x8A04,0x8A05}; Int_t fwDetStrawUnpackers[10] = {0x8B00,0x8B01,0x8B02,0x8B03,0x8B10,0x8B11,0x8B12,0x8B13,0x8B14,0x8B15}; Int_t fwDetRpcUnpackers [2] = {0x8C00,0x8C10}; Int_t iTofUnpackers [1] = {0x8d00}; if(detector("latch",l)) {source->addUnpacker( new HLatchUnpacker(startUnpackers[0]) ); ::Info("", "Adding LATCH unpacker");} if(detector("tbox",l)) {source->addUnpacker( new HTBoxUnpacker(startUnpackers[0]) ); ::Info("", "Adding TBOX unpacker");} if(detector("rich",l)){ ::Info("", "Adding RICH unpackers"); vectorids; for(UInt_t i=0; i<(sizeof(richUnpackers)/sizeof(Int_t)); i++){ cout<setMinAddress(Trbnet::kRICHTrb3MinTrbnetAddress); // set this for auto registering TDCs, otherwise tdc list will be used from lookup table //unp->setMaxAddress(Trbnet::kRICHTrb3MaxTrbnetAddress); // set this for auto registering TDCs, otherwise tdc list will be used from lookup table unp->setDebugFlag(0); unp->setQuietMode(); unp->shiftTimes(1100.); source->addUnpacker( unp ); } if(detector("mdc",l)){ ::Info("", "Adding MDC unpackers"); for(UInt_t i=0; i<(sizeof(mdcUnpackers)/sizeof(Int_t)); i++) { cout<setQuietMode(kTRUE,kFALSE); mdc_unpacker->setFillDataWord(kFALSE); mdc_unpacker->setFillOepStatus(kTRUE); mdc_unpacker->setPersistencyDataword(kTRUE); mdc_unpacker->setPersistencyOepStatusData(kFALSE); source->addUnpacker( (HMdcUnpacker*)mdc_unpacker ); } cout<ids; ids.clear(); for(UInt_t i=0; i<(sizeof(tofUnpackers)/sizeof(Int_t)); i++){ ids.push_back(tofUnpackers[i]); cout<disableTimeRef(kTRUE); tofUnp->setDebugFlag(0); tofUnp->setQuietMode(); tofUnp->shiftTimes(1100.); source->addUnpacker( tofUnp ); } if(detector("start",l)){ ::Info("", "Adding START unpackers"); vectorids; for(UInt_t i=0; i<(sizeof(startUnpackersTrb3)/sizeof(Int_t)); i++){ cout<setDebugFlag(0); startUnp->setQuietMode(); startUnp->setCTSId(0x8000); //startUnp->setMinAddress(Trbnet::kStartTrb3MinTrbnetAddress); // set this for auto registering TDCs, otherwise tdc list will be used from lookup table //startUnp->setMaxAddress(Trbnet::kStartTrb3MaxTrbnetAddress); // set this for auto registering TDCs, otherwise tdc list will be used from lookup table startUnp->shiftTimes(1100.); source->addUnpacker( startUnp ); } if(detector("rpc",l)){ ::Info("", "Adding RPC unpackers"); vectorids; ids.clear(); for(UInt_t i=0; i<(sizeof(rpcUnpackers)/sizeof(Int_t)); i++){ cout<setQuietMode(); rpcTrb3Unpacker->setDebugFlag(0); rpcTrb3Unpacker->storeSpareChannelsData(); //rpcTrb3Unpacker->setMinAddress(Trbnet::kRpcTrb3MinTrbnetAddress); // set this for auto registering TDCs, otherwise tdc list will be used from lookup table //rpcTrb3Unpacker->setMaxAddress(Trbnet::kRpcTrb3MaxTrbnetAddress); // set this for auto registering TDCs, otherwise tdc list will be used from lookup table rpcTrb3Unpacker->shiftTimes(1100.); source->addUnpacker(rpcTrb3Unpacker); } if(detector("emc",l)) { ::Info("", "Adding Emc unpackers"); vectorids; for(UInt_t i=0; i<(sizeof(emcUnpackers)/sizeof(Int_t)); i++){ cout<setMinAddress(Trbnet::kEmcTrb3MinTrbnetAddress); // set this for auto registering TDCs, otherwise tdc list will be used from lookup table //emcUnp->setMaxAddress(Trbnet::kEmcTrb3MaxTrbnetAddress); // set this for auto registering TDCs, otherwise tdc list will be used from lookup table emcUnp->setDebugFlag(0); emcUnp->setQuietMode(); emcUnp->shiftTimes(1100.); source->addUnpacker( emcUnp ); } if(detector("sts",l)) { ::Info("", "Adding Sts unpackers"); vectorids; for(UInt_t i=0; i<(sizeof(fwDetStrawUnpackers)/sizeof(Int_t)); i++){ cout<setMinAddress(Trbnet::kStsTrb3MinTrbnetAddress); // set this for auto registering TDCs, otherwise tdc list will be used from lookup table //fwdetStrawUnp->setMaxAddress(Trbnet::kStsTrb3MaxTrbnetAddress); // set this for auto registering TDCs, otherwise tdc list will be used from lookup table fwdetStrawUnp->setDebugFlag(0); fwdetStrawUnp->setQuietMode(); fwdetStrawUnp->shiftTimes(1100.); source->addUnpacker( fwdetStrawUnp ); } if(detector("frpc",l)) { ::Info("", "Adding FRpc unpackers"); vectorids; for(UInt_t i=0; i<(sizeof(fwDetRpcUnpackers)/sizeof(Int_t)); i++){ cout<setMinAddress(Trbnet::kFRpcTrb3MinTrbnetAddress); // set this for auto registering TDCs, otherwise tdc list will be used from lookup table //fwdetRpcUnp->setMaxAddress(Trbnet::kFRpcTrb3MaxTrbnetAddress); // set this for auto registering TDCs, otherwise tdc list will be used from lookup table fwdetRpcUnp->setDebugFlag(0); fwdetRpcUnp->setQuietMode(); fwdetRpcUnp->shiftTimes(1100.); source->addUnpacker( fwdetRpcUnp ); } if(detector("itof",l)){ ::Info("", "Adding iTOF unpackers"); vectorids; for(UInt_t i=0; i<(sizeof(iTofUnpackers)/sizeof(Int_t)); i++){ cout<setDebugFlag(0); iTofUnp->setQuietMode(); //iTofUnp->setMinAddress(Trbnet::kiTofTrb3MinTrbnetAddress); // set this for auto registering TDCs, otherwise tdc list will be used from lookup table //iTofUnp->setMaxAddress(Trbnet::kiTofTrb3MaxTrbnetAddress); // set this for auto registering TDCs, otherwise tdc list will be used from lookup table iTofUnp->shiftTimes(1100.); source->addUnpacker( iTofUnp ); } } else if(beamtime == "feb24"){ ::Info("", "Using feb24 setup"); Int_t mdcUnpackers [12] = {0x1100,0x1110,0x1120,0x1130,0x1140,0x1150,0x1000,0x1010,0x1020,0x1030,0x1040,0x1050}; Int_t rpcUnpackers [6] = {0x84c0, 0x84c1, 0x84c2, 0x84c3, 0x84c4, 0x84c5}; Int_t startUnpackers [1] = {0x8800}; // CTS-Hub Int_t startUnpackersTrb3 [2] = {0x8880,0x8890}; //start+veto Int_t tofUnpackers [6] = {0x86c0, 0x86c1,0x86c2, 0x86c3, 0x86c4, 0x86c5}; // feb21 trb3 Int_t richUnpackers [12] = {0x83c0,0x83c1,0x83c2,0x83c3,0x83c4,0x83c5,0x83c6,0x83c7,0x83c8,0x83c9,0x83ca,0x83cb}; Int_t emcUnpackers [6] = {0x8A00,0x8A01,0x8A02,0x8A03,0x8A04,0x8A05}; Int_t wallUnpackersTrb3 [3] = {0x8700,0x8701,0x8702}; // if(detector("latch",l)) {source->addUnpacker( new HLatchUnpacker(startUnpackers[0]) ); ::Info("", "Adding LATCH unpacker");} if(detector("tbox",l)) {source->addUnpacker( new HTBoxUnpacker(startUnpackers[0]) ); ::Info("", "Adding TBOX unpacker");} if(detector("rich",l)){ ::Info("", "Adding RICH unpackers"); vectorids; for(UInt_t i=0; i<(sizeof(richUnpackers)/sizeof(Int_t)); i++){ cout<setMinAddress(Trbnet::kRICHTrb3MinTrbnetAddress); // set this for auto registering TDCs, otherwise tdc list will be used from lookup table //unp->setMaxAddress(Trbnet::kRICHTrb3MaxTrbnetAddress); // set this for auto registering TDCs, otherwise tdc list will be used from lookup table unp->setDebugFlag(0); unp->setQuietMode(); unp->shiftTimes(1100.); source->addUnpacker( unp ); } if(detector("mdc",l)){ ::Info("", "Adding MDC unpackers"); for(UInt_t i=0; i<(sizeof(mdcUnpackers)/sizeof(Int_t)); i++) { cout<setQuietMode(kTRUE,kFALSE); mdc_unpacker->setFillDataWord(kFALSE); mdc_unpacker->setFillOepStatus(kTRUE); mdc_unpacker->setPersistencyDataword(kTRUE); mdc_unpacker->setPersistencyOepStatusData(kFALSE); source->addUnpacker( (HMdcUnpacker*)mdc_unpacker ); } cout<ids; ids.clear(); for(UInt_t i=0; i<(sizeof(tofUnpackers)/sizeof(Int_t)); i++){ ids.push_back(tofUnpackers[i]); cout<disableTimeRef(kTRUE); tofUnp->setDebugFlag(0); tofUnp->setQuietMode(); tofUnp->shiftTimes(1100.); source->addUnpacker( tofUnp ); } if(detector("start",l)){ ::Info("", "Adding START unpackers"); vectorids; for(UInt_t i=0; i<(sizeof(startUnpackersTrb3)/sizeof(Int_t)); i++){ cout<setDebugFlag(0); startUnp->setQuietMode(); startUnp->setCTSId(0x8000); //startUnp->setMinAddress(Trbnet::kStartTrb3MinTrbnetAddress); // set this for auto registering TDCs, otherwise tdc list will be used from lookup table //startUnp->setMaxAddress(Trbnet::kStartTrb3MaxTrbnetAddress); // set this for auto registering TDCs, otherwise tdc list will be used from lookup table startUnp->shiftTimes(1100.); source->addUnpacker( startUnp ); } if(detector("rpc",l)){ ::Info("", "Adding RPC unpackers"); vectorids; ids.clear(); for(UInt_t i=0; i<(sizeof(rpcUnpackers)/sizeof(Int_t)); i++){ cout<setQuietMode(); rpcTrb3Unpacker->setDebugFlag(0); rpcTrb3Unpacker->storeSpareChannelsData(); //rpcTrb3Unpacker->setMinAddress(Trbnet::kRpcTrb3MinTrbnetAddress); // set this for auto registering TDCs, otherwise tdc list will be used from lookup table //rpcTrb3Unpacker->setMaxAddress(Trbnet::kRpcTrb3MaxTrbnetAddress); // set this for auto registering TDCs, otherwise tdc list will be used from lookup table rpcTrb3Unpacker->shiftTimes(1100.); source->addUnpacker(rpcTrb3Unpacker); } if(detector("emc",l)) { ::Info("", "Adding Emc unpackers"); vectorids; for(UInt_t i=0; i<(sizeof(emcUnpackers)/sizeof(Int_t)); i++){ cout<setMinAddress(Trbnet::kEmcTrb3MinTrbnetAddress); // set this for auto registering TDCs, otherwise tdc list will be used from lookup table //emcUnp->setMaxAddress(Trbnet::kEmcTrb3MaxTrbnetAddress); // set this for auto registering TDCs, otherwise tdc list will be used from lookup table emcUnp->setDebugFlag(0); emcUnp->setQuietMode(); emcUnp->shiftTimes(1100.); source->addUnpacker( emcUnp ); } if(detector("wall",l)) { ::Info("", "Adding WALL TRB3 unpackers"); vectorids; for(UInt_t i=0; i<(sizeof(wallUnpackersTrb3)/sizeof(Int_t)); i++) { cout<setQuietMode(); wallUnpacker->setDebugFlag(0); wallUnpacker->shiftTimes(1100.); source->addUnpacker( wallUnpacker); } } //////////////////////////////////////////////////////////////////////////////////////////////////////////////////// ////////////////////////////// TEST for new MDC FEE (JAm, Septembern 2024) else if(beamtime == "apr25"){ ::Info("", "Using apr25 setup"); // OLD addresses: 0x2PSB (plane,sector, board) for each oep // paritioning of the hubs/subevents below from datasources.db: // 0x1000 0 MDC12sec1 high lxhadeb14 0 // 0x1010 0 MDC12sec2 high lxhadeb14 0 // 0x1020 0 MDC12sec3 high lxhadeb14 0 // 0x1030 0 MDC12sec4 high lxhadeb14 0 // 0x1040 0 MDC12sec5 high lxhadeb14 0 // 0x1050 0 MDC12sec6 high lxhadeb14 0 // 0x1100 0 MDC34sec1 high lxhadeb18 0 // 0x1110 0 MDC34sec2 mid lxhadeb18 0 // 0x1120 0 MDC34sec3 high lxhadeb18 0 // 0x1130 0 MDC34sec4 mid lxhadeb18 0 // 0x1140 0 MDC34sec5 high lxhadeb18 0 // 0x1150 0 MDC34sec6 high lxhadeb18 0 // # new MDC below: JAM // #0x8500 1 MDC12sec1 high lxhadeb14 2 // #0x8510 1 MDC12sec2 high lxhadeb14 2 // #0x8520 1 MDC12sec3 high lxhadeb14 2 // #0x8530 1 MDC12sec4 high lxhadeb14 2 // #0x8540 1 MDC12sec5 high lxhadeb14 2 // 0x8550 0 MDC12sec6 high lxhadeb14 2 // #0x8560 1 MDC34sec1 high lxhadeb14 2 // #0x8570 1 MDC34sec2 high lxhadeb14 2 // #0x8580 1 MDC34sec3 high lxhadeb14 2 // #0x8590 1 MDC34sec4 high lxhadeb14 2 // #0x85a0 1 MDC34sec5 high lxhadeb14 2 // #0x85b0 1 MDC34sec6 high lxhadeb14 2 ///////////////////////////////////////////// // full setup with old FEE: Int_t mdcUnpackers [12] = {0x1000,0x1010,0x1020,0x1030,0x1040,0x1050,0x1100,0x1110,0x1120,0x1130,0x1140,0x1150}; // need this still to create raw categories! // full setup of new FEE: Int_t mdcNewUnpackers [12] = {0x8500,0x8510,0x8520,0x8530,0x8540,0x8550,0x8560,0x8570,0x8580,0x8590,0x85a0,0x85b0}; //Int_t mdcUnpackers [11] = {0x1100,0x1110,0x1120,0x1130,0x1140,0x1150,0x1000,0x1010,0x1020,0x1030,0x1040}; // keep still existing old subevents here //Int_t mdcNewUnpackers [2] = {0x8500, 0x8550}; // put new subevents here Int_t rpcUnpackers [6] = {0x84c0, 0x84c1, 0x84c2, 0x84c3, 0x84c4, 0x84c5}; Int_t startUnpackers [1] = {0x8800}; // CTS-Hub Int_t startUnpackersTrb3 [2] = {0x8880,0x8890}; //start+veto Int_t tofUnpackers [6] = {0x86c0, 0x86c1,0x86c2, 0x86c3, 0x86c4, 0x86c5}; // feb21 trb3 Int_t richUnpackers [12] = {0x83c0,0x83c1,0x83c2,0x83c3,0x83c4,0x83c5,0x83c6,0x83c7,0x83c8,0x83c9,0x83ca,0x83cb}; Int_t emcUnpackers [6] = {0x8A00,0x8A01,0x8A02,0x8A03,0x8A04,0x8A05}; Int_t wallUnpackersTrb3 [3] = {0x8700,0x8701,0x8702}; // if(detector("latch",l)) {source->addUnpacker( new HLatchUnpacker(startUnpackers[0]) ); ::Info("", "Adding LATCH unpacker");} if(detector("tbox",l)) {source->addUnpacker( new HTBoxUnpacker(startUnpackers[0]) ); ::Info("", "Adding TBOX unpacker");} if(detector("rich",l)){ ::Info("", "Adding RICH unpackers"); vectorids; for(UInt_t i=0; i<(sizeof(richUnpackers)/sizeof(Int_t)); i++){ cout<setMinAddress(Trbnet::kRICHTrb3MinTrbnetAddress); // set this for auto registering TDCs, otherwise tdc list will be used from lookup table //unp->setMaxAddress(Trbnet::kRICHTrb3MaxTrbnetAddress); // set this for auto registering TDCs, otherwise tdc list will be used from lookup table unp->setDebugFlag(0); unp->setQuietMode(); unp->shiftTimes(1100.); source->addUnpacker( unp ); } if(detector("mdc",l)){ ::Info("", "Adding MDC unpackers"); for(UInt_t i=0; i<(sizeof(mdcUnpackers)/sizeof(Int_t)); i++) { cout<setQuietMode(kTRUE,kFALSE); mdc_unpacker->setFillDataWord(kFALSE); mdc_unpacker->setFillOepStatus(kTRUE); mdc_unpacker->setPersistencyDataword(kTRUE); mdc_unpacker->setPersistencyOepStatusData(kFALSE); source->addUnpacker( (HMdcUnpacker*)mdc_unpacker ); } cout<ids; for(UInt_t i=0; i<(sizeof(mdcNewUnpackers)/sizeof(Int_t)); i++){ cout<setMinAddress(Trbnet::kMdcTrbCMinTrbnetAddress); // set this for auto registering TDCs, otherwise tdc list will be used from lookup table //ctdc_unp->setMaxAddress(Trbnet::kMdcTrbCMaxTrbnetAddress); // set this for auto registering TDCs, otherwise tdc list will be used from lookup table ctdc_unp->setCTSId(0xC500); // test setup only? ctdc_unp->setHUBId(0x8500); // test setup only? //ctdc_unp->shiftTimes(500.); ctdc_unp->setDebugFlag(0); ctdc_unp->setQuietMode(); ctdc_unp->shiftTimes(1100.); ctdc_unp->setCompatibilityShift(2000); source->addUnpacker(ctdc_unp ); cout<ids; ids.clear(); for(UInt_t i=0; i<(sizeof(tofUnpackers)/sizeof(Int_t)); i++){ ids.push_back(tofUnpackers[i]); cout<disableTimeRef(kTRUE); // JAM kTRUE argument means we _do_ substract reference time. tofUnp->setDebugFlag(0); tofUnp->setQuietMode(); tofUnp->shiftTimes(1100.); source->addUnpacker( tofUnp ); } if(detector("start",l)){ ::Info("", "Adding START unpackers"); vectorids; for(UInt_t i=0; i<(sizeof(startUnpackersTrb3)/sizeof(Int_t)); i++){ cout<setDebugFlag(0); startUnp->setQuietMode(); startUnp->setCTSId(0x8000); //startUnp->setMinAddress(Trbnet::kStartTrb3MinTrbnetAddress); // set this for auto registering TDCs, otherwise tdc list will be used from lookup table //startUnp->setMaxAddress(Trbnet::kStartTrb3MaxTrbnetAddress); // set this for auto registering TDCs, otherwise tdc list will be used from lookup table startUnp->shiftTimes(1100.); source->addUnpacker( startUnp ); } if(detector("rpc",l)){ ::Info("", "Adding RPC unpackers"); vectorids; ids.clear(); for(UInt_t i=0; i<(sizeof(rpcUnpackers)/sizeof(Int_t)); i++){ cout<setQuietMode(); rpcTrb3Unpacker->setDebugFlag(0); rpcTrb3Unpacker->storeSpareChannelsData(); //rpcTrb3Unpacker->setMinAddress(Trbnet::kRpcTrb3MinTrbnetAddress); // set this for auto registering TDCs, otherwise tdc list will be used from lookup table //rpcTrb3Unpacker->setMaxAddress(Trbnet::kRpcTrb3MaxTrbnetAddress); // set this for auto registering TDCs, otherwise tdc list will be used from lookup table rpcTrb3Unpacker->shiftTimes(1100.); source->addUnpacker(rpcTrb3Unpacker); } if(detector("emc",l)) { ::Info("", "Adding Emc unpackers"); vectorids; for(UInt_t i=0; i<(sizeof(emcUnpackers)/sizeof(Int_t)); i++){ cout<setMinAddress(Trbnet::kEmcTrb3MinTrbnetAddress); // set this for auto registering TDCs, otherwise tdc list will be used from lookup table //emcUnp->setMaxAddress(Trbnet::kEmcTrb3MaxTrbnetAddress); // set this for auto registering TDCs, otherwise tdc list will be used from lookup table emcUnp->setDebugFlag(0); emcUnp->setQuietMode(); emcUnp->shiftTimes(1100.); source->addUnpacker( emcUnp ); } if(detector("wall",l)) { ::Info("", "Adding WALL TRB3 unpackers"); vectorids; for(UInt_t i=0; i<(sizeof(wallUnpackersTrb3)/sizeof(Int_t)); i++) { cout<setQuietMode(); wallUnpacker->setDebugFlag(0); wallUnpacker->shiftTimes(1100.); source->addUnpacker( wallUnpacker); } } else { ::Error( "setupUnpackers()","unknown beamtime = %s!",beamtime.Data()); exit(1); } } vector HDst::setSplitable(Bool_t print) { // set objects with custom streamers splitable. This enbales // the streamin to Tree oon splimode for ROOT6. In ROOT5 this // was the default behaviour. Only objects for Tree output // (Catgegories + data objects) are treated. // returns vector with classnames vnamesSplit.clear(); /* #!/bin/bash find . -name "*Def.h" | xargs -i grep "-" {} | grep -v "//" | grep -v "\*" | sed 's/#pragma link C++ class //' | sed 's/-;//' > streamer.txt file=split_header.h for c in $(cat streamer.txt) do result=$(grep $c $file) if [ "$result" == "" ] then echo new Class $c else echo found $c fi done */ /* // parameter container are not streamed to tree ==> ignore HTrbLookupChan::Class()->SetCanSplit(1); HDetGeomPar::Class()->SetCanSplit(1); HParSet::Class()->SetCanSplit(1); HRuntimeDb::Class()->SetCanSplit(1); HObjTable::Class()->SetCanSplit(1); HMdcCal2ParSim::Class()->SetCanSplit(1); HMdcCalParRaw::Class()->SetCanSplit(1); HMdcGeomStruct::Class()->SetCanSplit(1); HMdcGeomSecStru::Class()->SetCanSplit(1); HMdcGeomModStru::Class()->SetCanSplit(1); HMdcLayerGeomParLay::Class()->SetCanSplit(1); HMdcLookupChan::Class()->SetCanSplit(1); HMdcLookupCell::Class()->SetCanSplit(1); HMdcOepAddrCorrPar::Class()->SetCanSplit(1); HMdcTdcChannel::Class()->SetCanSplit(1); HMdcTdcThreshold::Class()->SetCanSplit(1); HMdcTimeCutMod::Class()->SetCanSplit(1); HMdcTrackGCorrections::Class()->SetCanSplit(1); HMdcTrackGCorrPar::Class()->SetCanSplit(1); HMdcTrackGField::Class()->SetCanSplit(1); HMetaMatchPar::Class()->SetCanSplit(1); HRichAnalysisPar::Class()->SetCanSplit(1); HRichDigitisationPar::Class()->SetCanSplit(1); HRichPadGraph::Class()->SetCanSplit(1); HRpcDigiPar::Class()->SetCanSplit(1); HTofCalParCell::Class()->SetCanSplit(1); HTofClusterFPar::Class()->SetCanSplit(1); HTofWalkPar::Class()->SetCanSplit(1); // tasks are not streamed to tree ==> ignore HTaskSet::Class()->SetCanSplit(1); HRichAnalysis::Class()->SetCanSplit(1); // spectrometer + detectors are not streamed to tree ==> ignore HSpectrometer::Class()->SetCanSplit(1); // others are not streamed to tree ==> ignore //HDiskCatalog::Class()->SetCanSplit(1); //HEDField::Class()->SetCanSplit(1); */ // datastruct HCategory::Class()->SetCanSplit(1); vnamesSplit.push_back(HCategory::Class()->GetName()); HIndexTable::Class()->SetCanSplit(1); vnamesSplit.push_back(HIndexTable::Class()->GetName()); HPairListI::Class()->SetCanSplit(1); vnamesSplit.push_back(HPairListI::Class()->GetName()); HLinearCategory::Class()->SetCanSplit(1); vnamesSplit.push_back(HLinearCategory::Class()->GetName()); HLocatedDataObject::Class()->SetCanSplit(1); vnamesSplit.push_back(HLocatedDataObject::Class()->GetName()); HMatrixCategory::Class()->SetCanSplit(1); vnamesSplit.push_back(HMatrixCategory::Class()->GetName()); Hades::Class()->SetCanSplit(1); vnamesSplit.push_back(Hades::Class()->GetName()); HEvent::Class()->SetCanSplit(1); vnamesSplit.push_back(HEvent::Class()->GetName()); HEventHeader::Class()->SetCanSplit(1); vnamesSplit.push_back(HEventHeader::Class()->GetName()); HVertex::Class()->SetCanSplit(1); vnamesSplit.push_back(HVertex::Class()->GetName()); HPartialEvent::Class()->SetCanSplit(1); vnamesSplit.push_back(HPartialEvent::Class()->GetName()); HRecEvent::Class()->SetCanSplit(1); vnamesSplit.push_back(HRecEvent::Class()->GetName()); // data objects HGeantKine::Class()->SetCanSplit(1); vnamesSplit.push_back(HGeantKine::Class()->GetName()); HGeantMdc::Class()->SetCanSplit(1); vnamesSplit.push_back(HGeantMdc::Class()->GetName()); HGeantRichPhoton::Class()->SetCanSplit(1); vnamesSplit.push_back(HGeantRichPhoton::Class()->GetName()); HGeantRichDirect::Class()->SetCanSplit(1); vnamesSplit.push_back(HGeantRichDirect::Class()->GetName()); HGeantRpc::Class()->SetCanSplit(1); vnamesSplit.push_back(HGeantRpc::Class()->GetName()); HGeantTof::Class()->SetCanSplit(1); vnamesSplit.push_back(HGeantTof::Class()->GetName()); HVirtualCand::Class()->SetCanSplit(1); vnamesSplit.push_back(HVirtualCand::Class()->GetName()); HVirtualCandSim::Class()->SetCanSplit(1); vnamesSplit.push_back(HVirtualCandSim::Class()->GetName()); HMdcSeg::Class()->SetCanSplit(1); vnamesSplit.push_back(HMdcSeg::Class()->GetName()); HMdcClusFit::Class()->SetCanSplit(1); vnamesSplit.push_back(HMdcClusFit::Class()->GetName()); HMdcWireFit::Class()->SetCanSplit(1); vnamesSplit.push_back(HMdcWireFit::Class()->GetName()); //HMdcSlopes::Class()->SetCanSplit(1); //vnamesSplit.push_back(HMdcSlopes::Class()->GetName()); HBaseTrack::Class()->SetCanSplit(1); vnamesSplit.push_back(HBaseTrack::Class()->GetName()); HMetaMatch2::Class()->SetCanSplit(1); vnamesSplit.push_back(HMetaMatch2::Class()->GetName()); HParticleBtRing::Class()->SetCanSplit(1); vnamesSplit.push_back(HParticleBtRing::Class()->GetName()); HKalOutput::Class()->SetCanSplit(1); vnamesSplit.push_back(HKalOutput::Class()->GetName()); HParticleCand::Class()->SetCanSplit(1); vnamesSplit.push_back(HParticleCand::Class()->GetName()); HParticleCandSim::Class()->SetCanSplit(1); vnamesSplit.push_back(HParticleCandSim::Class()->GetName()); HParticleEvtInfo::Class()->SetCanSplit(1); vnamesSplit.push_back(HParticleEvtInfo::Class()->GetName()); HPionTrackerTrack::Class()->SetCanSplit(1); vnamesSplit.push_back(HPionTrackerTrack::Class()->GetName()); HRichCal::Class()->SetCanSplit(1); vnamesSplit.push_back(HRichCal::Class()->GetName()); HRichCalSim::Class()->SetCanSplit(1); vnamesSplit.push_back(HRichCalSim::Class()->GetName()); HRichHit::Class()->SetCanSplit(1); vnamesSplit.push_back(HRichHit::Class()->GetName()); HStart2Cal::Class()->SetCanSplit(1); vnamesSplit.push_back(HStart2Cal::Class()->GetName()); HStart2Hit::Class()->SetCanSplit(1); vnamesSplit.push_back(HStart2Hit::Class()->GetName()); HStart2Raw::Class()->SetCanSplit(1); vnamesSplit.push_back(HStart2Raw::Class()->GetName()); HTofCluster::Class()->SetCanSplit(1); vnamesSplit.push_back(HTofCluster::Class()->GetName()); HTofHit::Class()->SetCanSplit(1); vnamesSplit.push_back(HTofHit::Class()->GetName()); HForwardCand::Class()->SetCanSplit(1); vnamesSplit.push_back(HForwardCand::Class()->GetName()); HForwardCandSim::Class()->SetCanSplit(1); vnamesSplit.push_back(HForwardCandSim::Class()->GetName()); HEmcNeutralCand::Class()->SetCanSplit(1); vnamesSplit.push_back(HEmcNeutralCand::Class()->GetName()); HEmcNeutralCandSim::Class()->SetCanSplit(1); vnamesSplit.push_back(HEmcNeutralCandSim::Class()->GetName()); if(print) printSplitable(); return vnamesSplit; } vector HDst::init() { vector v; return v; } void HDst::printSplitable() { cout<<"--------------------------------------------"< HDst::vnamesSplit = HDst::init();