$treeview $search $mathjax $extrastylesheet
otsdaq
v2_03_00
$projectbrief
|
$projectbrief
|
$searchbox |
00001 #include "otsdaq-core/RootUtilities/DQMHistosOuterTracker.h" 00002 #include "otsdaq-core/ConfigurationInterface/ConfigurationManager.h" 00003 #include "otsdaq-core/DataDecoders/FSSRData.h" 00004 #include "otsdaq-core/DataDecoders/VIPICData.h" 00005 #include "otsdaq-core/NetworkUtilities/NetworkConverters.h" 00006 00007 #include "otsdaq-core/ConfigurationDataFormats/FEInterfaceTableBase.h" 00008 #include "otsdaq-core/TablePluginDataFormats/DataBufferTable.h" 00009 #include "otsdaq-core/TablePluginDataFormats/DataManagerTable.h" 00010 #include "otsdaq-core/TablePluginDataFormats/DetectorTable.h" 00011 #include "otsdaq-core/TablePluginDataFormats/DetectorToFETable.h" 00012 #include "otsdaq-core/TablePluginDataFormats/FETable.h" 00013 #include "otsdaq-core/TablePluginDataFormats/UDPDataListenerProducerTable.h" 00014 #include "otsdaq-core/TablePluginDataFormats/UDPDataStreamerConsumerTable.h" 00015 //#include 00016 //"otsdaq-demo/UserConfigurationDataFormats/FEWROtsUDPFSSRInterfaceTable.h" 00017 //#include 00018 //"otsdaq-demo/UserConfigurationDataFormats/FEWRPurdueFSSRInterfaceTable.h" 00019 00020 #include <iostream> 00021 #include <sstream> 00022 #include <string> 00023 00024 #include <TCanvas.h> 00025 #include <TDirectory.h> 00026 #include <TFile.h> 00027 #include <TFrame.h> 00028 #include <TH1.h> 00029 #include <TH1F.h> 00030 #include <TH2.h> 00031 #include <TH2F.h> 00032 #include <TProfile.h> 00033 #include <TROOT.h> 00034 #include <TRandom.h> 00035 #include <TStyle.h> 00036 #include <TThread.h> 00037 00038 #include <stdint.h> 00039 //#include <arpa/inet.h> 00040 00041 // ROOT documentation 00042 // http://root.cern.ch/root/html/index.html 00043 00044 using namespace ots; 00045 00046 //======================================================================================================================== 00047 DQMHistosOuterTracker::DQMHistosOuterTracker(std::string supervisorApplicationUID, 00048 std::string bufferUID, 00049 std::string processorUID) 00050 : theFile_(0) 00051 , theDataDecoder_(supervisorApplicationUID, bufferUID, processorUID) 00052 , supervisorApplicationUID_(supervisorApplicationUID) 00053 , bufferUID_(bufferUID) 00054 , processorUID_(processorUID) 00055 { 00056 gStyle->SetPalette(1); 00057 } 00058 00059 //======================================================================================================================== 00060 DQMHistosOuterTracker::~DQMHistosOuterTracker(void) { closeFile(); } 00061 00062 //======================================================================================================================== 00063 void DQMHistosOuterTracker::openFile(std::string fileName) 00064 { 00065 closeFile(); 00066 currentDirectory_ = 0; 00067 theFile_ = TFile::Open(fileName.c_str(), "RECREATE"); 00068 theFile_->cd(); 00069 } 00070 00071 //======================================================================================================================== 00072 void DQMHistosOuterTracker::book() 00073 { 00074 std::cout << __COUT_HDR_FL__ << "Booking start!" << std::endl; 00075 00076 currentDirectory_ = theFile_->mkdir("General", "General"); 00077 currentDirectory_->cd(); 00078 numberOfTriggers_ = new TH1I("NumberOfTriggers", "Number of triggers", 1, -0.5, 0.5); 00079 currentDirectory_ = theFile_->mkdir("Planes", "Planes"); 00080 currentDirectory_->cd(); 00081 std::stringstream name; 00082 std::stringstream title; 00083 // FIXME 00084 const FEConfiguration* feConfiguration = 00085 theConfigurationManager_->__GET_CONFIG__(FEConfiguration); 00086 const DetectorToFEConfiguration* detectorToFEConfiguration = 00087 theConfigurationManager_->__GET_CONFIG__(DetectorToFEConfiguration); 00088 const DataManagerConfiguration* dataManagerConfiguration = 00089 theConfigurationManager_->__GET_CONFIG__(DataManagerConfiguration); 00090 const DataBufferConfiguration* dataBufferConfiguration = 00091 theConfigurationManager_->__GET_CONFIG__(DataBufferConfiguration); 00092 const UDPDataStreamerConsumerConfiguration* dataStreamerConsumerConfiguration = 00093 theConfigurationManager_->__GET_CONFIG__(UDPDataStreamerConsumerConfiguration); 00094 const DetectorConfiguration* detectorConfiguration = 00095 theConfigurationManager_->__GET_CONFIG__(DetectorConfiguration); 00096 00097 // const std::string supervisorType_; 00098 // const unsigned int supervisorInstance_; 00099 // const unsigned int bufferUID_; 00100 // const std::string processorUID_; 00101 00102 std::stringstream processName; 00103 std::vector<std::string> bufferList = 00104 dataManagerConfiguration->getListOfDataBuffers(); 00105 std::vector<std::string> interfaceList = feConfiguration->getListOfFEIDs(); 00106 for(const auto& itInterfaces : interfaceList) 00107 { 00108 std::string streamToIP; 00109 std::string streamToPort; 00110 00111 // RAR -- on June 28 00112 // Eric changed this to Base.. but this functionality does not belong in 00113 // ConfiguraitonBase If LORE wants this functionality then move to otsdaq_demo 00114 // repository since it depends on interfaces in demo (Or think about how to 00115 // extract this dependency?.. should there be an intermediate class that 00116 // interfaces have to inherit from to have DQM functionality?) 00117 if(feConfiguration->getFEInterfaceType(itInterfaces).find("FSSRInterface") != 00118 std::string::npos) 00119 { 00120 const TableBase* interfaceConfiguration = 00121 theConfigurationManager_->getTableByName( 00122 feConfiguration->getFEInterfaceType(itInterfaces) + "Table"); 00123 auto feinterfaceConfiguration = 00124 dynamic_cast<const FEInterfaceTableBase*>(interfaceConfiguration); 00125 if(feinterfaceConfiguration) 00126 { 00127 streamToIP = 00128 feinterfaceConfiguration->getStreamingIPAddress(itInterfaces); 00129 streamToPort = feinterfaceConfiguration->getStreamingPort(itInterfaces); 00130 } 00131 } 00132 00133 for(const auto& itBuffers : bufferList) 00134 { 00135 std::vector<std::string> producerList = 00136 dataBufferConfiguration->getProducerIDList(itBuffers); 00137 std::vector<std::string> consumerList = 00138 dataBufferConfiguration->getConsumerIDList(itBuffers); 00139 for(const auto& itProducers : producerList) 00140 { 00141 if(dataBufferConfiguration->getProducerClass(itBuffers, itProducers) == 00142 "UDPDataListenerProducer") 00143 { 00144 const UDPDataListenerProducerConfiguration* listerConfiguration = 00145 static_cast<const UDPDataListenerProducerConfiguration*>( 00146 theConfigurationManager_->getTableByName( 00147 "UDPDataListenerProducerConfiguration")); 00148 if(listerConfiguration->getIPAddress(itProducers) == streamToIP && 00149 listerConfiguration->getPort(itProducers) == streamToPort) 00150 { 00151 for(const auto& itConsumers : consumerList) 00152 { 00153 std::cout << __COUT_HDR_FL__ 00154 << "CONSUMER LIST: " << itConsumers << std::endl; 00155 if(dataBufferConfiguration->getConsumerClass( 00156 itBuffers, itConsumers) == "UDPDataStreamerConsumer") 00157 { 00158 // FIXME This is very bad since I am getting the PC IP 00159 // Hardcoded!!!!!!! 00160 std::string ipAddress = NetworkConverters::nameToStringIP( 00161 dataStreamerConsumerConfiguration->getIPAddress( 00162 itConsumers)); 00163 // FIXME the streamer should have it's own configured port 00164 // and not fedport +1 00165 std::string port = 00166 NetworkConverters::unsignedToStringPort( 00167 dataStreamerConsumerConfiguration->getPort( 00168 itConsumers)); 00169 planeOccupancies_[ipAddress][port] = 00170 std::map<unsigned int, TH1*>(); 00171 std::cout << __COUT_HDR_FL__ << "IP: " 00172 << NetworkConverters::stringToNameIP(ipAddress) 00173 << " Port:----" 00174 << NetworkConverters::stringToUnsignedPort(port) 00175 << "----" << std::endl; 00176 const std::vector<std::string> rocList = 00177 detectorToFEConfiguration->getFEReaderDetectorList( 00178 itInterfaces); 00179 std::cout << __COUT_HDR_FL__ 00180 << "List of rocs for FER: " << itInterfaces 00181 << " has size: " << rocList.size() << std::endl; 00182 for(const auto& itROC : rocList) 00183 { 00184 std::string ROCType = 00185 detectorConfiguration->getDetectorType(itROC); 00186 // std::cout << __COUT_HDR_FL__ << __PRETTY_FUNCTION__ 00187 // << "ROC type: " << ROCType << std::endl; 00188 if(ROCType == "FSSR") 00189 { 00190 unsigned int fedChannel = 00191 detectorToFEConfiguration->getFEReaderChannel( 00192 itROC); 00193 if(planeOccupancies_[ipAddress][port].find( 00194 fedChannel) == 00195 planeOccupancies_[ipAddress][port].end()) 00196 { 00197 name.str(""); 00198 title.str(""); 00199 name << "Plane_FE" << itInterfaces 00200 << "_Channel" << fedChannel 00201 << "_Occupancy"; 00202 title << "Plane FE" << itInterfaces 00203 << " Channel" << fedChannel 00204 << " Occupancy"; 00205 std::cout << __COUT_HDR_FL__ 00206 << "Adding:" << name.str() 00207 << std::endl; 00208 planeOccupancies_[ipAddress][port] 00209 [fedChannel] = new TH1F( 00210 name.str().c_str(), 00211 title.str().c_str(), 00212 640, 00213 -0.5, 00214 639.5); 00215 } 00216 } 00217 } 00218 } 00219 } 00220 } 00221 } 00222 } 00223 } 00224 } 00225 /* 00226 for(const auto& it: consumerList) 00227 { 00228 std::cout << __COUT_HDR_FL__ << "CONSUMER LIST: " << it << std::endl; 00229 if((dataBufferConfiguration->getConsumerClass(itBuffers,it) == 00230 "UDPDataStreamerConsumer") && (it.find("Purdue") != std::string::npos || it.find("OtsUDP") 00231 != std::string::npos)) 00232 { 00233 //FIXME This is very bad since I am getting the PC IP Hardcoded!!!!!!! 00234 std::string ipAddress = 00235 NetworkConverters::nameToStringIP(dataStreamerConsumerConfiguration->getIPAddress(it)); 00236 //FIXME the streamer should have it's own configured port and not fedport +1 00237 std::string port = 00238 NetworkConverters::unsignedToStringPort(dataStreamerConsumerConfiguration->getPort(it)); 00239 planeOccupancies_[ipAddress][port] = std::map<unsigned int, TH1*); 00240 std::cout << __COUT_HDR_FL__ << "IP: " << 00241 NetworkConverters::stringToNameIP(ipAddress) << " Port:----" << 00242 NetworkConverters::stringToUnsignedPort(port) << "----" << std::endl; 00243 std::vector<std::string> interfaceList = feConfiguration->getListOfFEIDs(); 00244 for(const auto& it: interfaceList) 00245 { 00246 std::cout << __COUT_HDR_FL__ << "Configuring histos for FER: " << it << 00247 std::endl; if(feConfiguration->getFEInterfaceType(it).find( "FSSRInterface" ) != 00248 std::string::npos) 00249 { 00250 //const OtsUDPFERConfiguration* OtsUDPFERConfiguration = 00251 theConfigurationManager_->__GET_CONFIG__(OtsUDPFERConfiguration); const 00252 std::vector<std::string> rocList = DetectorToFEConfiguration->getFERROCsList(it); 00253 std::cout << __COUT_HDR_FL__ << "List of rocs for FER: " << it << " 00254 has size: " << rocList.size() << std::endl; for(const auto& itROC: rocList) 00255 { 00256 std::string ROCType = detectorConfiguration->getROCType(itROC); 00257 //std::cout << __COUT_HDR_FL__ << __PRETTY_FUNCTION__ << "ROC 00258 type: " << ROCType << std::endl; if(ROCType == "FSSR") 00259 { 00260 unsigned int fedChannel = 00261 DetectorToFEConfiguration->getFERChannel(itROC); 00262 if(planeOccupancies_[ipAddress][port].find(fedChannel) == 00263 planeOccupancies_[ipAddress][port].end()) 00264 { 00265 name.str(""); 00266 title.str(""); 00267 name << "Plane_FE" << it << "_Channel"<< fedChannel << 00268 "_Occupancy"; title << "Plane FE" << it << " Channel"<< fedChannel << " Occupancy"; 00269 std::cout << __COUT_HDR_FL__ << "Adding:" << name.str() << 00270 std::endl; planeOccupancies_[ipAddress][port][fedChannel] = new TH1F(name.str().c_str(), 00271 title.str().c_str(), 640, -0.5, 639.5); 00272 } 00273 } 00274 else if (ROCType == "VIPIC") 00275 { 00276 unsigned int fedChannel = 00277 DetectorToFEConfiguration->getFERChannel(itROC); 00278 if(planeOccupancies_[ipAddress][port].find(fedChannel) == 00279 planeOccupancies_[ipAddress][port].end()) 00280 { 00281 name.str(""); 00282 title.str(""); 00283 name << "Plane_FER" << it << "_Channel"<< fedChannel << 00284 "_Occupancy"; title << "Plane FER" << it << " Channel"<< fedChannel << " Occupancy"; 00285 std::cout << __COUT_HDR_FL__ << __PRETTY_FUNCTION__ << 00286 "Adding:" << name << std::endl; planeOccupancies_[ipAddress][port][fedChannel] = new 00287 TH2F(name.str().c_str(), title.str().c_str(), 64, -0.5, 63.5, 64, -0.5, 63.5); 00288 } 00289 } 00290 } 00291 } 00292 } 00293 } 00294 00295 } 00296 } 00297 */ 00298 std::cout << __COUT_HDR_FL__ << "Booking done!" << std::endl; 00299 /* 00300 for(unsigned int p=0; p<4; p++) 00301 { 00302 name.str(""); 00303 title.str(""); 00304 name << "Plane_" << p << "_Occupancy"; 00305 title << "Plane " << p << " Occupancy"; 00306 planeOccupancies_.push_back(new TH1I(name.str().c_str(), title.str().c_str(), 00307 640, 0, 640)); 00308 } 00309 */ 00310 00311 // Create a new canvas 00312 // canvas_ = new TCanvas("MainCanvas", "Main Canvas", 200, 10, 700, 500); 00313 // canvas_->SetFillColor(42); 00314 // canvas_->GetFrame()->SetFillColor(21); 00315 // canvas_->GetFrame()->SetBorderSize(6); 00316 // canvas_->GetFrame()->SetBorderMode(-1); 00317 // directory_->Append(canvas_); 00318 00319 // Create a 1-D, 2-D and a profile histogram 00320 // histo1D_ = new TH1F("Histo1D", "This is the px distribution", 100, -4, 4); 00321 // histo2D_ = new TH2F("Histo2D", "py vs px", 40, -4, 4, 40, -4, 4); 00322 // profile_ = new TProfile("Profile", "Profile of pz versus px", 100, -4, 4, 0, 20); 00323 // gDirectory->ls(); 00324 00325 // Set canvas/frame attributes (save old attributes) 00326 // histo1D_->SetFillColor(48); 00327 00328 // gROOT->cd(); 00329 } 00330 00331 //======================================================================================================================== 00332 void DQMHistosOuterTracker::fill(std::string& buffer, 00333 std::map<std::string, std::string> header) 00334 { 00335 // std::cout << __COUT_HDR_FL__ << buffer.length() << std::endl; 00336 // int triggerNumber = 0; 00337 // int triggerHigh = 0; 00338 // int triggerLow = 0; 00339 // unsigned long ipAddress = (((header["IPAddress"][0]&0xff)<<24) + 00340 // ((header["IPAddress"][1]&0xff)<<16) + ((header["IPAddress"][2]&0xff)<<8) + 00341 // (header["IPAddress"][3]&0xff)) & 0xffffffff; 00342 std::string ipAddress = header["IPAddress"]; 00343 std::string port = header["Port"]; 00344 00345 // std::cout << __COUT_HDR_FL__ << "Got data from IP: " << 00346 // NetworkConverters::stringToNameIP(ipAddress) << " port: " << 00347 // NetworkConverters::stringToUnsignedPort(port) << std::endl; 00348 00349 if(NetworkConverters::stringToUnsignedPort(port) == 48003) 00350 theDataDecoder_.convertBuffer(buffer, convertedBuffer_, false); 00351 else 00352 theDataDecoder_.convertBuffer(buffer, convertedBuffer_, true); 00353 // std::cout << __COUT_HDR_FL__ << "New buffer" << std::endl; 00354 unsigned int bufferCounter = 0; 00355 uint32_t oldData = 0; 00356 while(!convertedBuffer_.empty()) 00357 { 00358 // if (!theDataDecoder_.isBCOHigh(convertedBuffer_.front()) 00359 // && !theDataDecoder_.isBCOLow(convertedBuffer_.front()) 00360 // && !theDataDecoder_.isTrigger(convertedBuffer_.front())) 00361 00362 if(NetworkConverters::stringToUnsignedPort(port) == 48003 && 00363 bufferCounter % 2 == 1) 00364 { 00365 convertedBuffer_.pop(); 00366 bufferCounter++; 00367 continue; 00368 } 00369 // if (NetworkConverters::stringToUnsignedPort(port) == 48003 && bufferCounter%2 00370 // == 0) std::cout << __COUT_HDR_FL__ << "Data: " << std::hex << 00371 // convertedBuffer_.front() << std::dec << std::endl; 00372 if(theDataDecoder_.isFSSRData(convertedBuffer_.front())) 00373 { 00374 // if(oldData != 0 && oldData==convertedBuffer_.front()) 00375 // std::cout << __COUT_HDR_FL__ << "There is a copy FSSR: " << 00376 // std::hex 00377 //<< convertedBuffer_.front() << " counter: " << bufferCounter << std::dec << 00378 // std::endl; 00379 oldData = convertedBuffer_.front(); 00380 FSSRData* detectorDataFSSR = 0; 00381 theDataDecoder_.decodeData(convertedBuffer_.front(), 00382 (DetectorDataBase**)&detectorDataFSSR); 00383 // if(detectorData->getChannelNumber() >= 4) 00384 //{ 00385 // std::cout << __COUT_HDR_FL__ << __PRETTY_FUNCTION__ << "Wrong channel: " 00386 // << detectorData->getChannelNumber() << std::endl; return; 00387 //} 00388 // std::cout << __COUT_HDR_FL__ << __PRETTY_FUNCTION__ << "Receiving data 00389 // from: " << hex << ipAddress << " port: " << port << std::endl; 00390 if(planeOccupancies_.find(ipAddress) != planeOccupancies_.end() && 00391 planeOccupancies_[ipAddress].find(port) != 00392 planeOccupancies_[ipAddress].end() && 00393 planeOccupancies_[ipAddress][port].find( 00394 detectorDataFSSR->getChannelNumber()) != 00395 planeOccupancies_[ipAddress][port].end()) 00396 planeOccupancies_[ipAddress][port][detectorDataFSSR->getChannelNumber()] 00397 ->Fill(detectorDataFSSR->getSensorStrip()); 00398 else 00399 std::cout << __COUT_HDR_FL__ 00400 << "ERROR: I haven't book histos for streamer " 00401 << NetworkConverters::stringToNameIP(ipAddress) 00402 << " port number: " 00403 << NetworkConverters::stringToUnsignedPort(port) 00404 << " channel: " << detectorDataFSSR->getChannelNumber() 00405 << " data: " << std::hex << convertedBuffer_.front() << std::dec 00406 << std::endl; 00407 // } 00408 // std::cout << __COUT_HDR_FL__ << __PRETTY_FUNCTION__ << processorUID_ << " 00409 // filling histograms!" << std::endl; 00410 // Float_t px, py, pz; 00411 // const Int_t kUPDATE = 1000; 00412 // std::cout << __COUT_HDR_FL__ << mthn << "Filling..." << std::endl; 00413 /* 00414 for (Int_t i = 1; i <= 1000; i++) 00415 { 00416 gRandom->Rannor(px, py); 00417 pz = px * px + py * py; 00418 histo1D_->Fill(px); 00419 histo2D_->Fill(px, py); 00420 profile_->Fill(px, pz); 00421 } 00422 */ 00423 } 00424 // if (theDataDecoder_.isVIPICData(convertedBuffer_.front())) 00425 // { 00426 // VIPICData* detectorDataVIPIC = 0; 00427 // theDataDecoder_.decodeData(convertedBuffer_.front(), 00428 //(DetectorDataBase**)&detectorDataVIPIC); 00429 // //if(detectorData->getChannelNumber() >= 4) 00430 // //{ 00431 // // std::cout << __COUT_HDR_FL__ << __PRETTY_FUNCTION__ << "Wrong 00432 // channel: " << detectorData->getChannelNumber() << std::endl; 00433 // // return; 00434 // //} 00435 // //std::cout << __COUT_HDR_FL__ << __PRETTY_FUNCTION__ << "Receiving 00436 // data from: " << hex << ipAddress << " port: " << port << std::endl; 00437 // if 00438 // ( planeOccupancies_.find(ipAddress) != 00439 // planeOccupancies_.end() 00440 // && planeOccupancies_[ipAddress].find(port) != 00441 // planeOccupancies_[ipAddress].end() 00442 // && 00443 // planeOccupancies_[ipAddress][port].find(detectorDataVIPIC->getChannelNumber()) 00445 // ) 00446 // planeOccupancies_[ipAddress][port][detectorDataVIPIC->getChannelNumber()]->Fill(detectorDataVIPIC->getCol(), 00447 // detectorDataVIPIC->getRow()); else std::cout << 00448 //__COUT_HDR_FL__ << "ERROR: I haven't book histos for streamer " << 00449 // NetworkConverters::stringToNameIP(ipAddress) 00450 // << " port number: " << NetworkConverters::stringToUnsignedPort(port) 00451 // << " port std::string:----" << port << "-----" 00452 // << " channel: " << detectorDataVIPIC->getChannelNumber() << std::endl; 00453 // // } 00454 // //std::cout << __COUT_HDR_FL__ << __PRETTY_FUNCTION__ << processorUID_ 00455 //<< " filling histograms!" << std::endl; 00456 // // Float_t px, py, pz; 00457 // // const Int_t kUPDATE = 1000; 00458 // // std::cout << __COUT_HDR_FL__ << mthn << "Filling..." << 00459 // std::endl; 00460 // /* 00461 // for (Int_t i = 1; i <= 1000; i++) 00462 // { 00463 // gRandom->Rannor(px, py); 00464 // pz = px * px + py * py; 00465 // histo1D_->Fill(px); 00466 // histo2D_->Fill(px, py); 00467 // profile_->Fill(px, pz); 00468 // } 00469 // */ 00470 // } 00471 00472 /* 00473 else if (theDataDecoder_.isTriggerLow(convertedBuffer_.front())) 00474 triggerLow = convertedBuffer_.front(); 00475 else if (theDataDecoder_.isTriggerHigh(convertedBuffer_.front())) 00476 { 00477 triggerHigh = convertedBuffer_.front(); 00478 triggerNumber = theDataDecoder_.mergeTriggerHighAndLow(triggerHigh,triggerLow); 00479 numberOfTriggers_->Fill(0); 00480 //std::cout << __COUT_HDR_FL__ << __PRETTY_FUNCTION__ << "Number of Triggers: " 00481 << triggerNumber << std::endl; 00482 //if(triggerNumber != numberOfTriggers_->GetEntries()) 00483 // std::cout << __COUT_HDR_FL__ << __PRETTY_FUNCTION__ << 00484 "---------------------------- ERROR: different trigger number " << triggerNumber 00485 << " entries: " << numberOfTriggers_->GetEntries() << std::endl; 00486 } 00487 */ 00488 convertedBuffer_.pop(); 00489 bufferCounter++; 00490 } 00491 /* 00492 std::cout << __COUT_HDR_FL__ << "base: " << typeid(detectorData).name() 00493 << "=" << typeid(FSSRData*).name() 00494 << " d cast: " << dynamic_cast<FSSRData*>(detectorData) 00495 << " r cast: " << static_cast<FSSRData*>(detectorData) 00496 << std::endl; 00497 if (dynamic_cast<FSSRData*>(detectorData) != 0) 00498 { 00499 FSSRData* data = (FSSRData*)detectorData; 00500 */ 00501 // std::cout << __COUT_HDR_FL__ << __PRETTY_FUNCTION__ << "Strip: " << std::endl; 00502 // std::cout << __COUT_HDR_FL__ << __PRETTY_FUNCTION__ << "Strip: " << 00503 // detectorData->getStripNumber() << std::endl; 00504 // std::cout << __COUT_HDR_FL__ << __PRETTY_FUNCTION__ << "Strip: " << 00505 // detectorData->getChannelNumber() << std::endl; 00506 } 00507 00508 //======================================================================================================================== 00509 void DQMHistosOuterTracker::save(void) 00510 { 00511 std::cout << __COUT_HDR_FL__ << __PRETTY_FUNCTION__ << "Saving file!" << std::endl; 00512 if(theFile_ != 0) 00513 theFile_->Write(); 00514 } 00515 00516 //======================================================================================================================== 00517 void DQMHistosOuterTracker::load(std::string fileName) 00518 { 00519 closeFile(); 00520 theFile_ = TFile::Open( 00521 fileName.c_str()); // WebPath/js/visualizers_lib/tmpRootData/Suca.root"); 00522 if(!theFile_->IsOpen()) 00523 return; 00524 theFile_->cd(); 00525 numberOfTriggers_ = (TH1I*)theFile_->Get("General/NumberOfTriggers"); 00526 00527 std::string directory = "Planes"; 00528 std::stringstream name; 00529 for(unsigned int p = 0; p < 4; p++) 00530 { 00531 name.str(""); 00532 name << directory << "/Plane_" << p << "_Occupancy"; 00533 // FIXME Must organize better all histograms!!!!! 00534 // planeOccupancies_.push_back((TH1I*)theFile_->Get(name.str().c_str())); 00535 } 00536 // canvas_ = (TCanvas*) theFile_->Get("MainDirectory/MainCanvas"); 00537 // histo1D_ = (TH1F*) theFile_->Get("MainDirectory/Histo1D"); 00538 // histo2D_ = (TH2F*) theFile_->Get("MainDirectory/Histo2D"); 00539 // profile_ = (TProfile*) theFile_->Get("MainDirectory/Profile"); 00540 closeFile(); 00541 } 00542 00543 //======================================================================================================================== 00544 void DQMHistosOuterTracker::closeFile(void) 00545 { 00546 if(theFile_ != 0) 00547 { 00548 theFile_->Close(); 00549 theFile_ = 0; 00550 } 00551 } 00552 00553 //======================================================================================================================== 00554 TObject* DQMHistosOuterTracker::get(std::string name) 00555 { 00556 if(theFile_ != 0) 00557 return theFile_->Get(name.c_str()); 00558 return 0; 00559 }