tests/src/Diagnose.cpp

Go to the documentation of this file.
00001 #include "MapsTrackManager.hh"
00002 #include "MapsTrack.hh"
00003 #include "MapsSensor.hh"
00004 #include "MapsException.hh"
00005 #include <cmath>
00006 #include <algorithm>
00007 #include <iostream>
00008 #include "TRandom2.h"
00009 #include "TFile.h"
00010 #include "TH1F.h"
00011 #include "Operators.h"
00012 
00013 int main(int argc, const char **argv) {
00014 
00015         if (argc != 2) {
00016                 std::cout << "Usage: Diagnose <input file> \n";
00017                 return 0;
00018         }
00019         std::cout << "Welcome to Diagnose...\n";
00020         
00021         //Define chi squared probability cuts
00022         double cut(0.1);
00023         //Define errors for chi squared calculation
00024         std::pair<double, double> error(0.1, 0.1);
00025         std::cout << "\tUsing cuts for probability of: \t" << cut << "\n";
00026         std::cout << "\tError parameters: \t" << error << "\n";
00027         
00028         std::cout << "\tRecreating from root file...\n";
00029         char input[100];
00030         strcpy(input, argv[1]);
00031         
00032         //Create a maps track manager to recreate the tracks
00033         MapsTrackManager mtm2;
00034         //Reinitialise all the tracks and sensors in mtm2
00035         mtm2.recreateFromRootFile(input);
00036 
00037         std::vector<MapsTrack*>& tracks = mtm2.getTracks();
00038 
00039         for (std::vector<MapsTrack*>::iterator it = tracks.begin(); it
00040                         != tracks.end(); it++) {
00041                 MapsTrack* t = *it;
00042 
00043                 //this is not obligatory, but highly advised!
00044                 t->setTrackError(error);
00045                 if(t->chiSqProb(0) > cut && t->chiSqProb(1) > cut)
00046                         diagnose(std::cout, *t);
00047         }
00048 }
00049 

Generated on Wed Mar 19 17:47:58 2008 for MapsTracks by  doxygen 1.5.2