otsdaq  v2_03_00
DQMHistosOuterTracker.cc
1 #include "otsdaq-core/RootUtilities/DQMHistosOuterTracker.h"
2 #include "otsdaq-core/ConfigurationInterface/ConfigurationManager.h"
3 #include "otsdaq-core/DataDecoders/FSSRData.h"
4 #include "otsdaq-core/DataDecoders/VIPICData.h"
5 #include "otsdaq-core/NetworkUtilities/NetworkConverters.h"
6 
7 #include "otsdaq-core/ConfigurationDataFormats/FEInterfaceTableBase.h"
8 #include "otsdaq-core/TablePluginDataFormats/DataBufferTable.h"
9 #include "otsdaq-core/TablePluginDataFormats/DataManagerTable.h"
10 #include "otsdaq-core/TablePluginDataFormats/DetectorTable.h"
11 #include "otsdaq-core/TablePluginDataFormats/DetectorToFETable.h"
12 #include "otsdaq-core/TablePluginDataFormats/FETable.h"
13 #include "otsdaq-core/TablePluginDataFormats/UDPDataListenerProducerTable.h"
14 #include "otsdaq-core/TablePluginDataFormats/UDPDataStreamerConsumerTable.h"
15 //#include
16 //"otsdaq-demo/UserConfigurationDataFormats/FEWROtsUDPFSSRInterfaceTable.h"
17 //#include
18 //"otsdaq-demo/UserConfigurationDataFormats/FEWRPurdueFSSRInterfaceTable.h"
19 
20 #include <iostream>
21 #include <sstream>
22 #include <string>
23 
24 #include <TCanvas.h>
25 #include <TDirectory.h>
26 #include <TFile.h>
27 #include <TFrame.h>
28 #include <TH1.h>
29 #include <TH1F.h>
30 #include <TH2.h>
31 #include <TH2F.h>
32 #include <TProfile.h>
33 #include <TROOT.h>
34 #include <TRandom.h>
35 #include <TStyle.h>
36 #include <TThread.h>
37 
38 #include <stdint.h>
39 //#include <arpa/inet.h>
40 
41 // ROOT documentation
42 // http://root.cern.ch/root/html/index.html
43 
44 using namespace ots;
45 
46 //========================================================================================================================
47 DQMHistosOuterTracker::DQMHistosOuterTracker(std::string supervisorApplicationUID,
48  std::string bufferUID,
49  std::string processorUID)
50  : theFile_(0)
51  , theDataDecoder_(supervisorApplicationUID, bufferUID, processorUID)
52  , supervisorApplicationUID_(supervisorApplicationUID)
53  , bufferUID_(bufferUID)
54  , processorUID_(processorUID)
55 {
56  gStyle->SetPalette(1);
57 }
58 
59 //========================================================================================================================
60 DQMHistosOuterTracker::~DQMHistosOuterTracker(void) { closeFile(); }
61 
62 //========================================================================================================================
63 void DQMHistosOuterTracker::openFile(std::string fileName)
64 {
65  closeFile();
66  currentDirectory_ = 0;
67  theFile_ = TFile::Open(fileName.c_str(), "RECREATE");
68  theFile_->cd();
69 }
70 
71 //========================================================================================================================
72 void DQMHistosOuterTracker::book()
73 {
74  std::cout << __COUT_HDR_FL__ << "Booking start!" << std::endl;
75 
76  currentDirectory_ = theFile_->mkdir("General", "General");
77  currentDirectory_->cd();
78  numberOfTriggers_ = new TH1I("NumberOfTriggers", "Number of triggers", 1, -0.5, 0.5);
79  currentDirectory_ = theFile_->mkdir("Planes", "Planes");
80  currentDirectory_->cd();
81  std::stringstream name;
82  std::stringstream title;
83  // FIXME
84  const FEConfiguration* feConfiguration =
85  theConfigurationManager_->__GET_CONFIG__(FEConfiguration);
86  const DetectorToFEConfiguration* detectorToFEConfiguration =
87  theConfigurationManager_->__GET_CONFIG__(DetectorToFEConfiguration);
88  const DataManagerConfiguration* dataManagerConfiguration =
89  theConfigurationManager_->__GET_CONFIG__(DataManagerConfiguration);
90  const DataBufferConfiguration* dataBufferConfiguration =
91  theConfigurationManager_->__GET_CONFIG__(DataBufferConfiguration);
92  const UDPDataStreamerConsumerConfiguration* dataStreamerConsumerConfiguration =
93  theConfigurationManager_->__GET_CONFIG__(UDPDataStreamerConsumerConfiguration);
94  const DetectorConfiguration* detectorConfiguration =
95  theConfigurationManager_->__GET_CONFIG__(DetectorConfiguration);
96 
97  // const std::string supervisorType_;
98  // const unsigned int supervisorInstance_;
99  // const unsigned int bufferUID_;
100  // const std::string processorUID_;
101 
102  std::stringstream processName;
103  std::vector<std::string> bufferList =
104  dataManagerConfiguration->getListOfDataBuffers();
105  std::vector<std::string> interfaceList = feConfiguration->getListOfFEIDs();
106  for(const auto& itInterfaces : interfaceList)
107  {
108  std::string streamToIP;
109  std::string streamToPort;
110 
111  // RAR -- on June 28
112  // Eric changed this to Base.. but this functionality does not belong in
113  // ConfiguraitonBase If LORE wants this functionality then move to otsdaq_demo
114  // repository since it depends on interfaces in demo (Or think about how to
115  // extract this dependency?.. should there be an intermediate class that
116  // interfaces have to inherit from to have DQM functionality?)
117  if(feConfiguration->getFEInterfaceType(itInterfaces).find("FSSRInterface") !=
118  std::string::npos)
119  {
120  const TableBase* interfaceConfiguration =
121  theConfigurationManager_->getTableByName(
122  feConfiguration->getFEInterfaceType(itInterfaces) + "Table");
123  auto feinterfaceConfiguration =
124  dynamic_cast<const FEInterfaceTableBase*>(interfaceConfiguration);
125  if(feinterfaceConfiguration)
126  {
127  streamToIP =
128  feinterfaceConfiguration->getStreamingIPAddress(itInterfaces);
129  streamToPort = feinterfaceConfiguration->getStreamingPort(itInterfaces);
130  }
131  }
132 
133  for(const auto& itBuffers : bufferList)
134  {
135  std::vector<std::string> producerList =
136  dataBufferConfiguration->getProducerIDList(itBuffers);
137  std::vector<std::string> consumerList =
138  dataBufferConfiguration->getConsumerIDList(itBuffers);
139  for(const auto& itProducers : producerList)
140  {
141  if(dataBufferConfiguration->getProducerClass(itBuffers, itProducers) ==
142  "UDPDataListenerProducer")
143  {
144  const UDPDataListenerProducerConfiguration* listerConfiguration =
145  static_cast<const UDPDataListenerProducerConfiguration*>(
146  theConfigurationManager_->getTableByName(
147  "UDPDataListenerProducerConfiguration"));
148  if(listerConfiguration->getIPAddress(itProducers) == streamToIP &&
149  listerConfiguration->getPort(itProducers) == streamToPort)
150  {
151  for(const auto& itConsumers : consumerList)
152  {
153  std::cout << __COUT_HDR_FL__
154  << "CONSUMER LIST: " << itConsumers << std::endl;
155  if(dataBufferConfiguration->getConsumerClass(
156  itBuffers, itConsumers) == "UDPDataStreamerConsumer")
157  {
158  // FIXME This is very bad since I am getting the PC IP
159  // Hardcoded!!!!!!!
160  std::string ipAddress = NetworkConverters::nameToStringIP(
161  dataStreamerConsumerConfiguration->getIPAddress(
162  itConsumers));
163  // FIXME the streamer should have it's own configured port
164  // and not fedport +1
165  std::string port =
166  NetworkConverters::unsignedToStringPort(
167  dataStreamerConsumerConfiguration->getPort(
168  itConsumers));
169  planeOccupancies_[ipAddress][port] =
170  std::map<unsigned int, TH1*>();
171  std::cout << __COUT_HDR_FL__ << "IP: "
172  << NetworkConverters::stringToNameIP(ipAddress)
173  << " Port:----"
174  << NetworkConverters::stringToUnsignedPort(port)
175  << "----" << std::endl;
176  const std::vector<std::string> rocList =
177  detectorToFEConfiguration->getFEReaderDetectorList(
178  itInterfaces);
179  std::cout << __COUT_HDR_FL__
180  << "List of rocs for FER: " << itInterfaces
181  << " has size: " << rocList.size() << std::endl;
182  for(const auto& itROC : rocList)
183  {
184  std::string ROCType =
185  detectorConfiguration->getDetectorType(itROC);
186  // std::cout << __COUT_HDR_FL__ << __PRETTY_FUNCTION__
187  // << "ROC type: " << ROCType << std::endl;
188  if(ROCType == "FSSR")
189  {
190  unsigned int fedChannel =
191  detectorToFEConfiguration->getFEReaderChannel(
192  itROC);
193  if(planeOccupancies_[ipAddress][port].find(
194  fedChannel) ==
195  planeOccupancies_[ipAddress][port].end())
196  {
197  name.str("");
198  title.str("");
199  name << "Plane_FE" << itInterfaces
200  << "_Channel" << fedChannel
201  << "_Occupancy";
202  title << "Plane FE" << itInterfaces
203  << " Channel" << fedChannel
204  << " Occupancy";
205  std::cout << __COUT_HDR_FL__
206  << "Adding:" << name.str()
207  << std::endl;
208  planeOccupancies_[ipAddress][port]
209  [fedChannel] = new TH1F(
210  name.str().c_str(),
211  title.str().c_str(),
212  640,
213  -0.5,
214  639.5);
215  }
216  }
217  }
218  }
219  }
220  }
221  }
222  }
223  }
224  }
225  /*
226  for(const auto& it: consumerList)
227  {
228  std::cout << __COUT_HDR_FL__ << "CONSUMER LIST: " << it << std::endl;
229  if((dataBufferConfiguration->getConsumerClass(itBuffers,it) ==
230 "UDPDataStreamerConsumer") && (it.find("Purdue") != std::string::npos || it.find("OtsUDP")
231 != std::string::npos))
232  {
233  //FIXME This is very bad since I am getting the PC IP Hardcoded!!!!!!!
234  std::string ipAddress =
235 NetworkConverters::nameToStringIP(dataStreamerConsumerConfiguration->getIPAddress(it));
236  //FIXME the streamer should have it's own configured port and not fedport +1
237  std::string port =
238 NetworkConverters::unsignedToStringPort(dataStreamerConsumerConfiguration->getPort(it));
239  planeOccupancies_[ipAddress][port] = std::map<unsigned int, TH1*);
240  std::cout << __COUT_HDR_FL__ << "IP: " <<
241 NetworkConverters::stringToNameIP(ipAddress) << " Port:----" <<
242 NetworkConverters::stringToUnsignedPort(port) << "----" << std::endl;
243  std::vector<std::string> interfaceList = feConfiguration->getListOfFEIDs();
244  for(const auto& it: interfaceList)
245  {
246  std::cout << __COUT_HDR_FL__ << "Configuring histos for FER: " << it <<
247 std::endl; if(feConfiguration->getFEInterfaceType(it).find( "FSSRInterface" ) !=
248 std::string::npos)
249  {
250  //const OtsUDPFERConfiguration* OtsUDPFERConfiguration =
251 theConfigurationManager_->__GET_CONFIG__(OtsUDPFERConfiguration); const
252 std::vector<std::string> rocList = DetectorToFEConfiguration->getFERROCsList(it);
253  std::cout << __COUT_HDR_FL__ << "List of rocs for FER: " << it << "
254 has size: " << rocList.size() << std::endl; for(const auto& itROC: rocList)
255  {
256  std::string ROCType = detectorConfiguration->getROCType(itROC);
257  //std::cout << __COUT_HDR_FL__ << __PRETTY_FUNCTION__ << "ROC
258 type: " << ROCType << std::endl; if(ROCType == "FSSR")
259  {
260  unsigned int fedChannel =
261 DetectorToFEConfiguration->getFERChannel(itROC);
262  if(planeOccupancies_[ipAddress][port].find(fedChannel) ==
263 planeOccupancies_[ipAddress][port].end())
264  {
265  name.str("");
266  title.str("");
267  name << "Plane_FE" << it << "_Channel"<< fedChannel <<
268 "_Occupancy"; title << "Plane FE" << it << " Channel"<< fedChannel << " Occupancy";
269  std::cout << __COUT_HDR_FL__ << "Adding:" << name.str() <<
270 std::endl; planeOccupancies_[ipAddress][port][fedChannel] = new TH1F(name.str().c_str(),
271 title.str().c_str(), 640, -0.5, 639.5);
272  }
273  }
274  else if (ROCType == "VIPIC")
275  {
276  unsigned int fedChannel =
277 DetectorToFEConfiguration->getFERChannel(itROC);
278  if(planeOccupancies_[ipAddress][port].find(fedChannel) ==
279 planeOccupancies_[ipAddress][port].end())
280  {
281  name.str("");
282  title.str("");
283  name << "Plane_FER" << it << "_Channel"<< fedChannel <<
284 "_Occupancy"; title << "Plane FER" << it << " Channel"<< fedChannel << " Occupancy";
285  std::cout << __COUT_HDR_FL__ << __PRETTY_FUNCTION__ <<
286 "Adding:" << name << std::endl; planeOccupancies_[ipAddress][port][fedChannel] = new
287 TH2F(name.str().c_str(), title.str().c_str(), 64, -0.5, 63.5, 64, -0.5, 63.5);
288  }
289  }
290  }
291  }
292  }
293  }
294 
295  }
296 }
297  */
298  std::cout << __COUT_HDR_FL__ << "Booking done!" << std::endl;
299  /*
300  for(unsigned int p=0; p<4; p++)
301  {
302  name.str("");
303  title.str("");
304  name << "Plane_" << p << "_Occupancy";
305  title << "Plane " << p << " Occupancy";
306  planeOccupancies_.push_back(new TH1I(name.str().c_str(), title.str().c_str(),
307  640, 0, 640));
308  }
309  */
310 
311  // Create a new canvas
312  // canvas_ = new TCanvas("MainCanvas", "Main Canvas", 200, 10, 700, 500);
313  // canvas_->SetFillColor(42);
314  // canvas_->GetFrame()->SetFillColor(21);
315  // canvas_->GetFrame()->SetBorderSize(6);
316  // canvas_->GetFrame()->SetBorderMode(-1);
317  // directory_->Append(canvas_);
318 
319  // Create a 1-D, 2-D and a profile histogram
320  // histo1D_ = new TH1F("Histo1D", "This is the px distribution", 100, -4, 4);
321  // histo2D_ = new TH2F("Histo2D", "py vs px", 40, -4, 4, 40, -4, 4);
322  // profile_ = new TProfile("Profile", "Profile of pz versus px", 100, -4, 4, 0, 20);
323  // gDirectory->ls();
324 
325  // Set canvas/frame attributes (save old attributes)
326  // histo1D_->SetFillColor(48);
327 
328  // gROOT->cd();
329 }
330 
331 //========================================================================================================================
332 void DQMHistosOuterTracker::fill(std::string& buffer,
333  std::map<std::string, std::string> header)
334 {
335  // std::cout << __COUT_HDR_FL__ << buffer.length() << std::endl;
336  // int triggerNumber = 0;
337  // int triggerHigh = 0;
338  // int triggerLow = 0;
339  // unsigned long ipAddress = (((header["IPAddress"][0]&0xff)<<24) +
340  // ((header["IPAddress"][1]&0xff)<<16) + ((header["IPAddress"][2]&0xff)<<8) +
341  // (header["IPAddress"][3]&0xff)) & 0xffffffff;
342  std::string ipAddress = header["IPAddress"];
343  std::string port = header["Port"];
344 
345  // std::cout << __COUT_HDR_FL__ << "Got data from IP: " <<
346  // NetworkConverters::stringToNameIP(ipAddress) << " port: " <<
347  // NetworkConverters::stringToUnsignedPort(port) << std::endl;
348 
349  if(NetworkConverters::stringToUnsignedPort(port) == 48003)
350  theDataDecoder_.convertBuffer(buffer, convertedBuffer_, false);
351  else
352  theDataDecoder_.convertBuffer(buffer, convertedBuffer_, true);
353  // std::cout << __COUT_HDR_FL__ << "New buffer" << std::endl;
354  unsigned int bufferCounter = 0;
355  uint32_t oldData = 0;
356  while(!convertedBuffer_.empty())
357  {
358  // if (!theDataDecoder_.isBCOHigh(convertedBuffer_.front())
359  // && !theDataDecoder_.isBCOLow(convertedBuffer_.front())
360  // && !theDataDecoder_.isTrigger(convertedBuffer_.front()))
361 
362  if(NetworkConverters::stringToUnsignedPort(port) == 48003 &&
363  bufferCounter % 2 == 1)
364  {
365  convertedBuffer_.pop();
366  bufferCounter++;
367  continue;
368  }
369  // if (NetworkConverters::stringToUnsignedPort(port) == 48003 && bufferCounter%2
370  // == 0) std::cout << __COUT_HDR_FL__ << "Data: " << std::hex <<
371  // convertedBuffer_.front() << std::dec << std::endl;
372  if(theDataDecoder_.isFSSRData(convertedBuffer_.front()))
373  {
374  // if(oldData != 0 && oldData==convertedBuffer_.front())
375  // std::cout << __COUT_HDR_FL__ << "There is a copy FSSR: " <<
376  // std::hex
377  //<< convertedBuffer_.front() << " counter: " << bufferCounter << std::dec <<
378  // std::endl;
379  oldData = convertedBuffer_.front();
380  FSSRData* detectorDataFSSR = 0;
381  theDataDecoder_.decodeData(convertedBuffer_.front(),
382  (DetectorDataBase**)&detectorDataFSSR);
383  // if(detectorData->getChannelNumber() >= 4)
384  //{
385  // std::cout << __COUT_HDR_FL__ << __PRETTY_FUNCTION__ << "Wrong channel: "
386  // << detectorData->getChannelNumber() << std::endl; return;
387  //}
388  // std::cout << __COUT_HDR_FL__ << __PRETTY_FUNCTION__ << "Receiving data
389  // from: " << hex << ipAddress << " port: " << port << std::endl;
390  if(planeOccupancies_.find(ipAddress) != planeOccupancies_.end() &&
391  planeOccupancies_[ipAddress].find(port) !=
392  planeOccupancies_[ipAddress].end() &&
393  planeOccupancies_[ipAddress][port].find(
394  detectorDataFSSR->getChannelNumber()) !=
395  planeOccupancies_[ipAddress][port].end())
396  planeOccupancies_[ipAddress][port][detectorDataFSSR->getChannelNumber()]
397  ->Fill(detectorDataFSSR->getSensorStrip());
398  else
399  std::cout << __COUT_HDR_FL__
400  << "ERROR: I haven't book histos for streamer "
401  << NetworkConverters::stringToNameIP(ipAddress)
402  << " port number: "
403  << NetworkConverters::stringToUnsignedPort(port)
404  << " channel: " << detectorDataFSSR->getChannelNumber()
405  << " data: " << std::hex << convertedBuffer_.front() << std::dec
406  << std::endl;
407  // }
408  // std::cout << __COUT_HDR_FL__ << __PRETTY_FUNCTION__ << processorUID_ << "
409  // filling histograms!" << std::endl;
410  // Float_t px, py, pz;
411  // const Int_t kUPDATE = 1000;
412  // std::cout << __COUT_HDR_FL__ << mthn << "Filling..." << std::endl;
413  /*
414  for (Int_t i = 1; i <= 1000; i++)
415  {
416  gRandom->Rannor(px, py);
417  pz = px * px + py * py;
418  histo1D_->Fill(px);
419  histo2D_->Fill(px, py);
420  profile_->Fill(px, pz);
421  }
422  */
423  }
424  // if (theDataDecoder_.isVIPICData(convertedBuffer_.front()))
425  // {
426  // VIPICData* detectorDataVIPIC = 0;
427  // theDataDecoder_.decodeData(convertedBuffer_.front(),
428  //(DetectorDataBase**)&detectorDataVIPIC);
429  // //if(detectorData->getChannelNumber() >= 4)
430  // //{
431  // // std::cout << __COUT_HDR_FL__ << __PRETTY_FUNCTION__ << "Wrong
432  // channel: " << detectorData->getChannelNumber() << std::endl;
433  // // return;
434  // //}
435  // //std::cout << __COUT_HDR_FL__ << __PRETTY_FUNCTION__ << "Receiving
436  // data from: " << hex << ipAddress << " port: " << port << std::endl;
437  // if
438  // ( planeOccupancies_.find(ipAddress) !=
439  // planeOccupancies_.end()
440  // && planeOccupancies_[ipAddress].find(port) !=
441  // planeOccupancies_[ipAddress].end()
442  // &&
443  // planeOccupancies_[ipAddress][port].find(detectorDataVIPIC->getChannelNumber())
445  // )
446  // planeOccupancies_[ipAddress][port][detectorDataVIPIC->getChannelNumber()]->Fill(detectorDataVIPIC->getCol(),
447  // detectorDataVIPIC->getRow()); else std::cout <<
448  //__COUT_HDR_FL__ << "ERROR: I haven't book histos for streamer " <<
449  // NetworkConverters::stringToNameIP(ipAddress)
450  // << " port number: " << NetworkConverters::stringToUnsignedPort(port)
451  // << " port std::string:----" << port << "-----"
452  // << " channel: " << detectorDataVIPIC->getChannelNumber() << std::endl;
453  // // }
454  // //std::cout << __COUT_HDR_FL__ << __PRETTY_FUNCTION__ << processorUID_
455  //<< " filling histograms!" << std::endl;
456  // // Float_t px, py, pz;
457  // // const Int_t kUPDATE = 1000;
458  // // std::cout << __COUT_HDR_FL__ << mthn << "Filling..." <<
459  // std::endl;
460  // /*
461  // for (Int_t i = 1; i <= 1000; i++)
462  // {
463  // gRandom->Rannor(px, py);
464  // pz = px * px + py * py;
465  // histo1D_->Fill(px);
466  // histo2D_->Fill(px, py);
467  // profile_->Fill(px, pz);
468  // }
469  // */
470  // }
471 
472  /*
473  else if (theDataDecoder_.isTriggerLow(convertedBuffer_.front()))
474  triggerLow = convertedBuffer_.front();
475  else if (theDataDecoder_.isTriggerHigh(convertedBuffer_.front()))
476  {
477  triggerHigh = convertedBuffer_.front();
478  triggerNumber = theDataDecoder_.mergeTriggerHighAndLow(triggerHigh,triggerLow);
479  numberOfTriggers_->Fill(0);
480  //std::cout << __COUT_HDR_FL__ << __PRETTY_FUNCTION__ << "Number of Triggers: "
481  << triggerNumber << std::endl;
482  //if(triggerNumber != numberOfTriggers_->GetEntries())
483  // std::cout << __COUT_HDR_FL__ << __PRETTY_FUNCTION__ <<
484  "---------------------------- ERROR: different trigger number " << triggerNumber
485  << " entries: " << numberOfTriggers_->GetEntries() << std::endl;
486  }
487  */
488  convertedBuffer_.pop();
489  bufferCounter++;
490  }
491  /*
492  std::cout << __COUT_HDR_FL__ << "base: " << typeid(detectorData).name()
493  << "=" << typeid(FSSRData*).name()
494  << " d cast: " << dynamic_cast<FSSRData*>(detectorData)
495  << " r cast: " << static_cast<FSSRData*>(detectorData)
496  << std::endl;
497  if (dynamic_cast<FSSRData*>(detectorData) != 0)
498  {
499  FSSRData* data = (FSSRData*)detectorData;
500  */
501  // std::cout << __COUT_HDR_FL__ << __PRETTY_FUNCTION__ << "Strip: " << std::endl;
502  // std::cout << __COUT_HDR_FL__ << __PRETTY_FUNCTION__ << "Strip: " <<
503  // detectorData->getStripNumber() << std::endl;
504  // std::cout << __COUT_HDR_FL__ << __PRETTY_FUNCTION__ << "Strip: " <<
505  // detectorData->getChannelNumber() << std::endl;
506 }
507 
508 //========================================================================================================================
509 void DQMHistosOuterTracker::save(void)
510 {
511  std::cout << __COUT_HDR_FL__ << __PRETTY_FUNCTION__ << "Saving file!" << std::endl;
512  if(theFile_ != 0)
513  theFile_->Write();
514 }
515 
516 //========================================================================================================================
517 void DQMHistosOuterTracker::load(std::string fileName)
518 {
519  closeFile();
520  theFile_ = TFile::Open(
521  fileName.c_str()); // WebPath/js/visualizers_lib/tmpRootData/Suca.root");
522  if(!theFile_->IsOpen())
523  return;
524  theFile_->cd();
525  numberOfTriggers_ = (TH1I*)theFile_->Get("General/NumberOfTriggers");
526 
527  std::string directory = "Planes";
528  std::stringstream name;
529  for(unsigned int p = 0; p < 4; p++)
530  {
531  name.str("");
532  name << directory << "/Plane_" << p << "_Occupancy";
533  // FIXME Must organize better all histograms!!!!!
534  // planeOccupancies_.push_back((TH1I*)theFile_->Get(name.str().c_str()));
535  }
536  // canvas_ = (TCanvas*) theFile_->Get("MainDirectory/MainCanvas");
537  // histo1D_ = (TH1F*) theFile_->Get("MainDirectory/Histo1D");
538  // histo2D_ = (TH2F*) theFile_->Get("MainDirectory/Histo2D");
539  // profile_ = (TProfile*) theFile_->Get("MainDirectory/Profile");
540  closeFile();
541 }
542 
543 //========================================================================================================================
544 void DQMHistosOuterTracker::closeFile(void)
545 {
546  if(theFile_ != 0)
547  {
548  theFile_->Close();
549  theFile_ = 0;
550  }
551 }
552 
553 //========================================================================================================================
554 TObject* DQMHistosOuterTracker::get(std::string name)
555 {
556  if(theFile_ != 0)
557  return theFile_->Get(name.c_str());
558  return 0;
559 }
void fill(std::string &buffer, std::map< std::string, std::string > header)