#include "MapsTrackManager.hh" #include "MapsTrack.hh" #include "MapsSensor.hh" #include "MapsException.hh" #include #include #include #include "TRandom2.h" #include "TFile.h" #include "TH1F.h" #include "Operators.h" int main(int argc, const char **argv) { if (argc != 2) { std::cout << "Usage: Diagnose \n"; return 0; } std::cout << "Welcome to Diagnose...\n"; //Define chi squared probability cuts double cut(0.1); //Define errors for chi squared calculation std::pair error(0.1, 0.1); std::cout << "\tUsing cuts for probability of: \t" << cut << "\n"; std::cout << "\tError parameters: \t" << error << "\n"; std::cout << "\tRecreating from root file...\n"; char input[100]; strcpy(input, argv[1]); //Create a maps track manager to recreate the tracks MapsTrackManager mtm2; //Reinitialise all the tracks and sensors in mtm2 mtm2.recreateFromRootFile(input); std::vector& tracks = mtm2.getTracks(); for (std::vector::iterator it = tracks.begin(); it != tracks.end(); it++) { MapsTrack* t = *it; //this is not obligatory, but highly advised! t->setTrackError(error); if(t->chiSqProb(0) > cut && t->chiSqProb(1) > cut) diagnose(std::cout, *t); } }