/data3/calcul/jacquem/working_dir/Micromegas/micromegasFrameWork/src/analyse/root/spark.cpp File Reference

#include <TROOT.h>
#include <TPaveLabel.h>
#include <TRint.h>
#include <TCanvas.h>
#include <TTree.h>
#include <TFile.h>
#include <TSystem.h>
#include <TGeoManager.h>
#include <TGeoMatrix.h>
#include <iostream>
#include <sstream>
#include "event/Run.hh"
#include "event/Event.hh"
#include "geometry/Board.hh"
#include "geometry/Chip.hh"
#include "geometry/Dif.hh"
#include "geometry/Chamber.hh"
#include "geometry/Detector.hh"
#include "geometry/GassiplexChamber1.hh"
#include "geometry/GassiplexChamber4.hh"
#include "geometry/Hardroc1Chamber.hh"
#include "xml/XMLTool.hh"
#include "tools/MicroException.hh"
#include "tools/Log.hh"
#include <TApplication.h>
#include <TGClient.h>
#include <TGListBox.h>
#include <TList.h>

Include dependency graph for spark.cpp:

Go to the source code of this file.

Functions

int main (int argc, char **argv)


Function Documentation

int main ( int  argc,
char **  argv 
)

Definition at line 45 of file spark.cpp.

00047 {  //un-named script to be run in ROOT framework
00048 
00049   FILELog::ReportingLevel() = FILELog::FromString(INFO);
00050 
00051   //----- Control usage and option
00052   if ( argc != 3 ) {
00053    FILE_LOG(logERROR)  << "usage: channelDisplay streeFile chamberId " << endl;
00054    exit(1);
00055   }
00056 
00057   string steerName;
00058   steerName.assign(argv[1]);
00059 
00060   string chamberId;
00061   chamberId.assign(argv[2]);
00062   ui32 chamId = atoi(chamberId.c_str());
00063 
00064   TApplication *theApp;
00065 
00066   argc = 1;
00067   theApp = new TRint("App", &argc, argv);
00068 
00069 
00070   /******************************************/
00071   /******************************************/
00072   /******************************************/
00073 
00074 // test if sterr file exist
00075   FILE *file = fopen(steerName.c_str(), "r");
00076   if(file == NULL){
00077     FILE_LOG(logERROR)  << "Steer file ["<< steerName.c_str() << "] does not exist" << endl;
00078     exit(0);
00079     fclose(file);
00080   }
00081 // create Run, set detector and steerDesc from steer XML file
00082     SteerDesc steerDesc;
00083     XMLTool xml;
00084     xml.parse(steerDesc, steerName);
00085 
00086     Detector detector;
00087     detector.build(steerDesc);
00088 
00089     Run run(detector);
00090 
00091     steerDesc.setRun(run);
00092 
00093     fclose(file);
00094 
00095 
00096   /******************************************/
00097   /******************************************/
00098   /******************************************/
00099   /******************************************/
00100   /******************************************/
00101   /******************************************/
00102 
00103 
00104    string txt = "";
00105 
00106    float xLength, yLength = 0;
00107 
00108    try {
00109     const Chamber &chamber = detector.getChamberById(chamId);
00110     xLength = chamber.getXLength();// + chamber.getX();
00111     yLength = chamber.getYLength();// + chamber.getY();
00112 
00113     int nbChannel = 0;
00114     const BoardMap_t &boards = chamber.getBoards();
00115     for (BoardMap_t::const_iterator boardIt = boards.begin(); boardIt != boards.end(); ++boardIt)
00116     {
00117       Board& board = *(boardIt->second);
00118       const ChipMap_t &chips = board.getChips();
00119       for (ChipMap_t::const_iterator chipIt = chips.begin(); chipIt != chips.end(); ++chipIt)
00120       {
00121          Chip& chip = *(chipIt->second);
00122      
00123          float x=chip.getX() - chamber.getX() ;
00124          float y=chip.getY() - chamber.getY();
00125          float z=chamber.getZ() ;
00126 
00127          float x2 = x+chip.getXLength();
00128          float y2 = y+chip.getYLength();
00129 
00130 
00131          cout << "-----hardid[" << chip.getId()<< "] "  << "\t";
00132          cout << "x[" << x << "], x2[" << x2 << "]    " << "\t" ; 
00133          cout << "y[" << y << "], y2[" << y2 << "]" << endl;
00134       }
00135     }
00136 
00137     string result = (chamber.getXrotation() == false) ? "No rotation over X" : "There is a rotation over X";
00138     FILE_LOG(logINFO) << result    << endl;
00139     result = (chamber.getYrotation() == false) ? "No rotation over Y" : "There is a rotation over Y";
00140     FILE_LOG(logINFO) << result    << endl;
00141     FILE_LOG(logINFO) << "" << endl;
00142     FILE_LOG(logINFO) << "                                            X" << endl;
00143     FILE_LOG(logINFO) << "                                             " << endl;
00144     FILE_LOG(logINFO) << "                                            /\\" << endl;
00145     FILE_LOG(logINFO) << "                                             |" << endl;
00146     FILE_LOG(logINFO) << "                                             |" << endl;
00147     FILE_LOG(logINFO) << "                                             |" << endl;
00148     FILE_LOG(logINFO) << "SYSTEM de COORDONNEES: (0,0) en bas a gauche X--->  Y    " << endl;
00149     FILE_LOG(logINFO) << "  Z sortant." << endl;
00150     FILE_LOG(logINFO) << "  Cote PAD Dif a gauche." << endl;
00151 
00152 
00153    } //end try
00154     catch ( MicroException e )
00155    {
00156    FILE_LOG(logERROR) << e.getMessage() << endl;
00157    }
00158 
00159    return 0;
00160 }


Generated on Mon Jan 7 13:17:22 2013 for MicromegasFramework by  doxygen 1.4.7