#include #include #include #include #include #include #include const int kNPmax = 1000; static TObjString monitor_name("Test"); class IExtractFromPlane: public COMET::ICOMETEventLoopFunction { public: IExtractFromPlane() { fLSOption = ""; fQuiet = false; fPrintList = false; fNormal.SetXYZ(0,0,1); fMonitorPos.SetXYZ(0,0,0); fMonitorRadius = 70; // Initialise some of the branches brEvtFlags = 0; brEvtCode = 0; brMonitorName = new TObjArray(); // the name of the monitor fOutputFile = new TFile("rootracker_output.root", "RECREATE"); fTree = new TTree("gRooTracker", "SimG4 event tree rootracker format"); fTree->Branch("EvtFlags", "TBits", &brEvtFlags, 32000, 1); fTree->Branch("EvtCode", "TObjString", &brEvtCode, 32000, 1); fTree->Branch("EvtNum", &brEvtNum, "EvtNum/I"); fTree->Branch("EvtXSec", &brEvtXSec, "EvtXSec/D"); fTree->Branch("EvtDXSec", &brEvtDXSec, "EvtDXSec/D"); fTree->Branch("EvtWght", &brEvtWght, "EvtWght/D"); fTree->Branch("EvtProb", &brEvtProb, "EvtProb/D"); fTree->Branch("EvtVtx", brEvtVtx, "EvtVtx[4]/D"); fTree->Branch("StdHepN", &brStdHepN, "StdHepN/I"); fTree->Branch("StdHepPdg", brStdHepPdg, "StdHepPdg[StdHepN]/I"); fTree->Branch("StdHepStatus", brStdHepStatus, "StdHepStatus[StdHepN]/I"); fTree->Branch("StdHepRescat", brStdHepRescat, "StdHepRescat[StdHepN]/I"); fTree->Branch("StdHepX4", brStdHepX4, "StdHepX4[StdHepN][4]/D"); fTree->Branch("StdHepP4", brStdHepP4, "StdHepP4[StdHepN][4]/D"); fTree->Branch("StdHepPolz", brStdHepPolz, "StdHepPolz[StdHepN][3]/D"); fTree->Branch("StdHepFd", brStdHepFd, "StdHepFd[StdHepN]/I"); fTree->Branch("StdHepLd", brStdHepLd, "StdHepLd[StdHepN]/I"); fTree->Branch("StdHepFm", brStdHepFm, "StdHepFm[StdHepN]/I"); fTree->Branch("StdHepLm", brStdHepLm, "StdHepLm[StdHepN]/I"); // Added for COMET fTree->Branch("Weight", brWeight, "Weight[StdHepN]/D"); fTree->Branch("MonitorName", "TObjArray", brMonitorName); } virtual ~IExtractFromPlane() {}; void Usage(void) { std::cout << " -O quiet Don't call TObject::ls()" << std::endl; std::cout << " -O list List events in the file" << std::endl; std::cout << " -O xpos=[val] x-position of the monitor in global coordinates [mm] (default: 0)" << std::endl; std::cout << " -O ypos=[val] y-position of the monitor in global coordinates [mm] (default: 0)" << std::endl; std::cout << " -O zpos=[val] z-position of the monitor in global coordinates [mm] (default: 0)" << std::endl; std::cout << " -O xnorm=[val] x value of the normal vector of the monitor in global coordinates (default: 0)" << std::endl; std::cout << " -O ynorm=[val] y value of the normal vector of the monitor in global coordinates (default: 0)" << std::endl; std::cout << " -O znorm=[val] z value of the normal vector of the monitor in global coordinates (default: 1)" << std::endl; std::cout << " -O radius=[val] radius of the monitor [mm] (default: 70 mm)" << std::endl; std::cout << " -O