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
00022 double cut(0.1);
00023
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
00033 MapsTrackManager mtm2;
00034
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
00044 t->setTrackError(error);
00045 if(t->chiSqProb(0) > cut && t->chiSqProb(1) > cut)
00046 diagnose(std::cout, *t);
00047 }
00048 }
00049