/** @ myAlg.cpp * * The main alignment code * * Interface with Millepede is made by MilleTool * * @author M.Needham */ #include #include // For ROOT #include "TFile.h" #include "TH1F.h" #include "TH2F.h" #include "TF1.h" // Knossos includes #include "LMDAlg.h" #include "MilleTool.h" //#include "Track.h" //#include "TrackStore.h" //#include "constantsLMD.h" #include "constantsTelescope.h"// description of test set-up in March 2015 using namespace std; LMDAlg::LMDAlg(){ // :m_rootFile(0),m_mis_aft(0),m_pullHistos(0) // constructer // m_mis_aft = new TObjArray; // m_pullHistos = new TObjArray; } LMDAlg::~LMDAlg() { // // destructer // delete m_GaussGenerator; delete m_align; // delete m_rootFile; } /* INITIALIZE: Initialization of the ROOTfile and the detector geometry */ bool LMDAlg::initialize(const jobParams& tparams) { m_params = tparams; output.open(params().outputFile().c_str()); // The tool to access millepede m_align = new MilleTool(); return true; } /* EXECUTE: */ bool LMDAlg::execute() { const int totnumsensors = nStation; // const int totnumsensors = nStation*nSides; //cout<<"m_params.nRun() = "< uSens; for(int ik=0; ikinitialize(totnumsensors,m_params.inputFile(),uSens); // int iteration = 0; bool readtrks=true; int nTrks_in = 0; for(int idtrk=0;idtrkaddTrack(); nTrks_in++; } // // ...finally make the alignment and print the results // m_align->globalFit(); const std::vector& par = m_align->parameters(); const std::vector& errors = m_align->errors(); const std::vector& pulls = m_align->pulls(); int nPlane = totnumsensors; cout<<"Alignment based on "<& par = m_align->parameters(); const std::vector& errors = m_align->errors(); const std::vector& pulls = m_align->pulls(); int nPlane = totnumsensors; // const int nTrks = m_align->GetNTracks(); //FOR test with Telescope, March 2015 output<<" Software alignment sugests following correction for translation [cm] and rotation [rad]:" << std::endl; for (unsigned int iPlane = 0; iPlane < totnumsensors ; ++iPlane) { // //FOR normal LMD/PANDAROOT // output<reset(); return true; } /* FINALIZE: */ bool LMDAlg::finalize() { // m_rootFile->Write(); std::cout << "*** Thats all folks ***" <