AliRoot Core  v5-06-15 (45dab64)
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
AliMUONCDB.cxx
Go to the documentation of this file.
1 /**************************************************************************
2  * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
3  * *
4  * Author: The ALICE Off-line Project. *
5  * Contributors are mentioned in the code where appropriate. *
6  * *
7  * Permission to use, copy, modify and distribute this software and its *
8  * documentation strictly for non-commercial purposes is hereby granted *
9  * without fee, provided that the above copyright notice appears in all *
10  * copies and that both the copyright notice and this permission notice *
11  * appear in the supporting documentation. The authors make no claims *
12  * about the suitability of this software for any purpose. It is *
13  * provided "as is" without express or implied warranty. *
14  **************************************************************************/
15 
16 /* $Id$ */
17 
18 //-----------------------------------------------------------------------------
32 //-----------------------------------------------------------------------------
33 
34 #include "AliMUONCDB.h"
35 
36 #include "AliMUON1DArray.h"
37 #include "AliMUON1DMap.h"
38 #include "AliMUON2DMap.h"
40 #include "AliMUONCalibParamND.h"
41 #include "AliMUONCalibParamNF.h"
42 #include "AliMUONCalibParamNI.h"
43 #include "AliMUONCalibrationData.h"
44 #include "AliMUONConstants.h"
46 #include "AliMUONLogger.h"
47 #include "AliMUONPadStatusMaker.h"
49 #include "AliMUONRecoParam.h"
51 #include "AliMUONRejectList.h"
52 #include "AliMUONTrackerData.h"
53 #include "AliMUONTrackerIO.h"
55 #include "AliMUONTriggerLut.h"
56 #include "AliMUONVCalibParam.h"
57 #include "AliMUONVCalibParam.h"
58 #include "AliMUONVStore.h"
59 
60 #include "AliMpCDB.h"
61 #include "AliMpConstants.h"
62 #include "AliMpDEStore.h"
63 #include "AliMpDDLStore.h"
64 #include "AliMpManuStore.h"
65 #include "AliMpDEManager.h"
66 #include "AliMpDetElement.h"
67 #include "AliMpFiles.h"
68 #include "AliMpDCSNamer.h"
69 #include "AliMpManuIterator.h"
70 #include "AliMpSegmentation.h"
71 #include "AliMpStationType.h"
72 #include "AliMpVSegmentation.h"
73 
74 #include "AliCodeTimer.h"
75 #include "AliCDBEntry.h"
76 #include "AliCDBManager.h"
77 #include "AliGRPManager.h"
78 #include "AliDCSValue.h"
79 #include "AliLog.h"
80 #include "AliMpBusPatch.h"
81 
82 #include <Riostream.h>
83 #include <TArrayI.h>
84 #include <TClass.h>
85 #include <TFile.h>
86 #include <TH1F.h>
87 #include <TList.h>
88 #include <TMap.h>
89 #include <TObjString.h>
90 #include <TROOT.h>
91 #include <TRandom.h>
92 #include <TStopwatch.h>
93 #include <TSystem.h>
94 #include <TMath.h>
95 #include <TGeoGlobalMagField.h>
96 #include <TClonesArray.h>
97 #include <sstream>
98 #include <set>
99 
100 using std::endl;
101 using std::cout;
102 using std::cerr;
103 using std::ostringstream;
104 using std::ifstream;
105 
106 namespace
107 {
108  //_____________________________________________________________________________
109 AliMUONVStore* Create2DMap()
110 {
111  return new AliMUON2DMap(true);
112 }
113 
114  //_____________________________________________________________________________
115 void getBoundaries(const AliMUONVStore& store, Int_t dim,
116  Float_t* xmin, Float_t* xmax)
117 {
121 
122  for ( Int_t i = 0; i < dim; ++i )
123  {
124  xmin[i]=1E30;
125  xmax[i]=-1E30;
126  }
127 
128  TIter next(store.CreateIterator());
129  AliMUONVCalibParam* value;
130 
131  while ( ( value = dynamic_cast<AliMUONVCalibParam*>(next() ) ) )
132  {
133  Int_t detElemId = value->ID0();
134  Int_t manuId = value->ID1();
135 
136  const AliMpVSegmentation* seg =
138 
139  if (!seg) continue;
140 
141  for ( Int_t manuChannel = 0; manuChannel < value->Size(); ++manuChannel )
142  {
143  AliMpPad pad = seg->PadByLocation(manuId,manuChannel,kFALSE);
144  if (!pad.IsValid()) continue;
145 
146  for ( Int_t i = 0; i < dim; ++i )
147  {
148  Float_t x0 = value->ValueAsFloat(manuChannel,i);
149 
150  xmin[i] = TMath::Min(xmin[i],x0);
151  xmax[i] = TMath::Max(xmax[i],x0);
152  }
153  }
154  }
155 
156  for ( Int_t i = 0; i < dim; ++i )
157  {
158  if ( TMath::Abs(xmin[i]-xmax[i]) < 1E-3 )
159  {
160  xmin[i] -= 1;
161  xmax[i] += 1;
162  }
163  }
164 }
165 
166 //_____________________________________________________________________________
167 Double_t GetRandom(Double_t mean, Double_t sigma, Bool_t mustBePositive)
168 {
169  Double_t x(-1);
170  if ( mustBePositive )
171  {
172  while ( x < 0 )
173  {
174  x = gRandom->Gaus(mean,sigma);
175  }
176  }
177  else
178  {
179  x = gRandom->Gaus(mean,sigma);
180  }
181  return x;
182 }
183 
184 }
185 
186 //_____________________________________________________________________________
187 Bool_t AliMUONCDB::CheckOCDB(Bool_t pathOnly)
188 {
190 
191  AliCDBManager* man = AliCDBManager::Instance();
192 
193  // first OCDB path
194  if (!man->IsDefaultStorageSet()) {
195  AliErrorGeneral("AliMUONCDB", "OCDB path must be properly set");
196  return kFALSE;
197  }
198 
199  // then run number if required
200  if (pathOnly) return kTRUE;
201  if (man->GetRun() < 0) {
202  AliErrorGeneral("AliMUONCDB", "Run number must be properly set");
203  return kFALSE;
204  }
205 
206  return kTRUE;
207 
208 }
209 
210 //_____________________________________________________________________________
211 Bool_t AliMUONCDB::CheckMapping(Bool_t segmentationOnly)
212 {
214 
215  // first the segmentation
216  if (!AliMpSegmentation::Instance(false)) {
217  AliErrorGeneral("AliMUONCDB", "Mapping segmentation must be loaded first");
218  return kFALSE;
219  }
220 
221  // then the others if required
222  if (segmentationOnly) return kTRUE;
223  if (!AliMpDDLStore::Instance(false) || !AliMpDEStore::Instance(false) || !AliMpManuStore::Instance(false)) {
224  AliErrorGeneral("AliMUONCDB", "Full mapping must be loaded first");
225  return kFALSE;
226  }
227 
228  return kTRUE;
229 
230 }
231 
232 //_____________________________________________________________________________
234 {
237 
238  AliInfoGeneral("AliMUONCDB","Loading field map from GRP...");
239 
240  if (!AliMUONCDB::CheckOCDB()) return kFALSE;
241 
242  AliGRPManager grpMan;
243 
244  // make sure the old field is deleted even if it is locked
245  if(TGeoGlobalMagField::Instance()->IsLocked()) delete TGeoGlobalMagField::Instance();
246 
247  if (!grpMan.ReadGRPEntry() || !grpMan.SetMagField()) {
248  AliErrorGeneral("AliMUONCDB", "failed to load magnetic field from OCDB");
249  return kFALSE;
250  }
251 
252  return kTRUE;
253 
254 }
255 
256 //_____________________________________________________________________________
257 Bool_t AliMUONCDB::LoadMapping(Bool_t segmentationOnly)
258 {
261 
262  AliInfoGeneral("AliMUONCDB", "Loading mapping from OCDB...");
263 
264  if (!AliMUONCDB::CheckOCDB()) return kFALSE;
265 
266  // in case it has already been set
268 
269  if (segmentationOnly) {
270 
271  if (!AliMpCDB::LoadMpSegmentation(kTRUE)){
272  AliErrorGeneral("AliMUONCDB", "failed to load segmentation from OCDB");
273  return kFALSE;
274  }
275 
276  } else {
277 
278  if (!AliMpCDB::LoadAll(kTRUE)) {
279  AliErrorGeneral("AliMUONCDB", "failed to load mapping from OCDB");
280  return kFALSE;
281  }
282 
283  }
284 
285  return kTRUE;
286 
287 }
288 
289 //_____________________________________________________________________________
291 {
294 
295  AliInfoGeneral("AliMUONCDB", "Loading RecoParam from OCDB...");
296 
297  if (!AliMUONCDB::CheckOCDB()) return 0x0;
298 
299  AliMUONRecoParam* recoParam = 0x0;
300  AliCDBEntry* entry = AliCDBManager::Instance()->Get("MUON/Calib/RecoParam");
301 
302  if(entry) {
303 
304  // load recoParam according OCDB content (single or array)
305  if (!(recoParam = dynamic_cast<AliMUONRecoParam*>(entry->GetObject()))) {
306 
307  TObjArray* recoParamArray = static_cast<TObjArray*>(entry->GetObject());
308 // recoParamArray->SetOwner(kTRUE); // FIXME: this should be done, but is causing a problem at the end of the reco... investigate why...
309 
310  for(Int_t i = 0; i < recoParamArray->GetEntriesFast(); i++) {
311  recoParam = static_cast<AliMUONRecoParam*>(recoParamArray->UncheckedAt(i));
312  if (recoParam->IsDefault()) break;
313  recoParam = 0x0;
314  }
315 
316  }
317 
318  }
319 
320  if (!recoParam) AliErrorGeneral("AliMUONCDB", "failed to load RecoParam from OCDB");
321 
322  return recoParam;
323 
324 }
325 
326 //_____________________________________________________________________________
328 {
330 
331  AliInfoGeneral("AliMUONCDB", "Loading Alignemnt from OCDB...");
332 
333  if (!AliMUONCDB::CheckOCDB()) return 0x0;
334 
335  TClonesArray* alignmentArray = 0x0;
336  AliCDBEntry* entry = AliCDBManager::Instance()->Get("MUON/Align/Data");
337 
338  if (entry) {
339  // load alignement array
340  alignmentArray = dynamic_cast<TClonesArray*>(entry->GetObject());
341  }
342 
343  if (!alignmentArray) {
344  AliErrorGeneral("AliMUONCDB", "failed to load Alignemnt from OCDB");
345  }
346 
347  return alignmentArray;
348 }
349 
350 //_____________________________________________________________________________
353  const char* opt)
354 {
361 
362  TString sopt(opt);
363  sopt.ToUpper();
364 
365  if ( !sopt.Contains("ABS") && !sopt.Contains("REL") && !sopt.Contains("PERCENT") )
366  {
367  AliErrorGeneral("AliMUONCDB", Form("opt %s not supported. Only ABS, REL, PERCENT are",opt));
368  return 0x0;
369  }
370 
371  AliMUONVStore* d = static_cast<AliMUONVStore*>(store1.Clone());
372 
373  TIter next(d->CreateIterator());
374 
375  AliMUONVCalibParam* param;
376 
377  while ( ( param = dynamic_cast<AliMUONVCalibParam*>(next() ) ) )
378  {
379  Int_t detElemId = param->ID0();
380  Int_t manuId = param->ID1();
381 
382  AliMUONVCalibParam* param2 = dynamic_cast<AliMUONVCalibParam*>(store2.FindObject(detElemId,manuId));
383  //FIXME: this might happen. Handle it.
384  if (!param2)
385  {
386  cerr << "param2 is null : FIXME : this might happen !" << endl;
387  delete d;
388  return 0;
389  }
390 
391  for ( Int_t i = 0; i < param->Size(); ++i )
392  {
393  for ( Int_t j = 0; j < param->Dimension(); ++j )
394  {
395  Float_t value(0);
396  if ( sopt.Contains("ABS") )
397  {
398  value = param->ValueAsFloat(i,j) - param2->ValueAsFloat(i,j);
399  }
400  else if ( sopt.Contains("REL") || sopt.Contains("PERCENT") )
401  {
402  if ( param->ValueAsFloat(i,j) )
403  {
404  value = (param->ValueAsFloat(i,j) - param2->ValueAsFloat(i,j))/param->ValueAsFloat(i,j);
405  }
406  else
407  {
408  continue;
409  }
410  if ( sopt.Contains("PERCENT") ) value *= 100.0;
411  }
412  param->SetValueAsFloat(i,j,value);
413  }
414  }
415  }
416  return d;
417 }
418 
419 //_____________________________________________________________________________
420 TH1**
421 AliMUONCDB::Plot(const AliMUONVStore& store, const char* name, Int_t nbins)
422 {
426 
427  if (!AliMUONCDB::CheckMapping(kTRUE)) return 0x0;
428 
429  TIter next(store.CreateIterator());
430  AliMUONVCalibParam* param;
431  Int_t n(0);
432  const Int_t kNStations = AliMpConstants::NofTrackingChambers()/2;
433  Int_t* nPerStation = new Int_t[kNStations];
434  TH1** h(0x0);
435 
436  for ( Int_t i = 0; i < kNStations; ++i ) nPerStation[i]=0;
437 
438  while ( ( param = static_cast<AliMUONVCalibParam*>(next()) ) )
439  {
440  if (!h)
441  {
442  Int_t dim = param->Dimension();
443  h = new TH1*[dim];
444  Float_t* xmin = new Float_t[dim];
445  Float_t* xmax = new Float_t[dim];
446  getBoundaries(store,dim,xmin,xmax);
447 
448  for ( Int_t i = 0; i < dim; ++i )
449  {
450  h[i] = new TH1F(Form("%s_%d",name,i),Form("%s_%d",name,i),
451  nbins,xmin[i],xmax[i]);
452  AliInfoGeneral("AliMUONCDB", Form("Created histogram %s",h[i]->GetName()));
453  }
454  delete [] xmin;
455  delete [] xmax;
456  }
457 
458  Int_t detElemId = param->ID0();
459  Int_t manuId = param->ID1();
460  Int_t station = AliMpDEManager::GetChamberId(detElemId)/2;
461 
462  const AliMpVSegmentation* seg =
464 
465  if (!seg) continue;
466 
467  for ( Int_t manuChannel = 0; manuChannel < param->Size(); ++manuChannel )
468  {
469  AliMpPad pad = seg->PadByLocation(manuId,manuChannel,kFALSE);
470  if (!pad.IsValid()) continue;
471 
472  ++n;
473  ++nPerStation[station];
474 
475  for ( Int_t dim = 0; dim < param->Dimension(); ++dim )
476  {
477  h[dim]->Fill(param->ValueAsFloat(manuChannel,dim));
478  }
479  }
480  }
481 
482  for ( Int_t i = 0; i < kNStations; ++i )
483  {
484  AliInfoGeneral("AliMUONCDB", Form("Station %d %d ",(i+1),nPerStation[i]));
485  }
486 
487  AliInfoGeneral("AliMUONCDB", Form("Number of channels = %d",n));
488 
489  delete[] nPerStation;
490 
491  return h;
492 }
493 
494 //_____________________________________________________________________________
495 Int_t
496 AliMUONCDB::MakeHVStore(TMap& aliasMap, Bool_t defaultValues)
497 {
499 
500  if (!AliMUONCDB::CheckMapping()) return 0;
501 
502  AliMpDCSNamer hvNamer("TRACKER");
503 
504  TObjArray* aliases = hvNamer.GenerateAliases();
505 
506  Int_t nSwitch(0);
507  Int_t nChannels(0);
508 
509  for ( Int_t i = 0; i < aliases->GetEntries(); ++i )
510  {
511  TObjString* alias = static_cast<TObjString*>(aliases->At(i));
512  TString& aliasName = alias->String();
513  if ( aliasName.Contains("sw") )
514  {
515  // HV Switch (St345 only)
516  TObjArray* valueSet = new TObjArray;
517  valueSet->SetOwner(kTRUE);
518 
519  Bool_t value = kTRUE;
520 
521  if (!defaultValues)
522  {
523  Float_t r = gRandom->Uniform();
524  if ( r < 0.007 ) value = kFALSE;
525  }
526 
527  for ( UInt_t timeStamp = 0; timeStamp < 60*3; timeStamp += 60 )
528  {
529  AliDCSValue* dcsValue = new AliDCSValue(value,timeStamp);
530  valueSet->Add(dcsValue);
531  }
532  aliasMap.Add(new TObjString(*alias),valueSet);
533  ++nSwitch;
534  }
535  else
536  {
537  TObjArray* valueSet = new TObjArray;
538  valueSet->SetOwner(kTRUE);
539  for ( UInt_t timeStamp = 0; timeStamp < 60*15; timeStamp += 120 )
540  {
541  Float_t value = 1500;
542  if (!defaultValues) value = GetRandom(1750,62.5,true);
543  AliDCSValue* dcsValue = new AliDCSValue(value,timeStamp);
544  valueSet->Add(dcsValue);
545  }
546  aliasMap.Add(new TObjString(*alias),valueSet);
547  ++nChannels;
548  }
549  }
550 
551  delete aliases;
552 
553  AliInfoGeneral("AliMUONCDB", Form("%d HV channels and %d switches",nChannels,nSwitch));
554 
555  return nChannels+nSwitch;
556 }
557 
558 //_____________________________________________________________________________
559 Int_t
560 AliMUONCDB::MakeTriggerDCSStore(TMap& aliasMap, Bool_t defaultValues)
561 {
563 
564  if (!AliMUONCDB::CheckMapping()) return 0;
565 
566  AliMpDCSNamer triggerDCSNamer("TRIGGER");
567 
568  TObjArray* aliases = triggerDCSNamer.GenerateAliases();
569 
570  Int_t nChannels[2] = {0, 0};
571 
572  for ( Int_t i = 0; i < aliases->GetEntries(); ++i )
573  {
574  TObjString* alias = static_cast<TObjString*>(aliases->At(i));
575  TString& aliasName = alias->String();
576 
577  TObjArray* valueSet = new TObjArray;
578  valueSet->SetOwner(kTRUE);
579 
580  Int_t measureType = triggerDCSNamer.DCSvariableFromDCSAlias(aliasName.Data());
581  if ( measureType < 0 ) {
582  AliErrorGeneralStream("AliMUONCDB")
583  << "Failed to get DCS variable from an alias (trigger): "
584  << aliasName.Data() << endl;
585  return 0;
586  }
587 
588  for ( UInt_t timeStamp = 0; timeStamp < 60*15; timeStamp += 120 )
589  {
590  Float_t value =
591  (measureType == AliMpDCSNamer::kDCSI) ? 2. : 8000.;
592  if (!defaultValues) {
593  switch (measureType){
595  value = GetRandom(2.,0.4,true);
596  break;
598  value = GetRandom(8000.,16.,true);
599  break;
600  }
601  }
602  AliDCSValue* dcsValue = new AliDCSValue(value,timeStamp);
603  valueSet->Add(dcsValue);
604  }
605  aliasMap.Add(new TObjString(*alias),valueSet);
606  ++nChannels[measureType];
607  }
608 
609  delete aliases;
610 
611  AliInfoGeneral("AliMUONCDB", Form("Trigger channels I -> %i HV -> %i",nChannels[0], nChannels[1]));
612 
613  return nChannels[0] + nChannels[1];
614 }
615 
616 //_____________________________________________________________________________
617 Int_t
618 AliMUONCDB::MakePedestalStore(AliMUONVStore& pedestalStore, Bool_t defaultValues)
619 {
623 
624  AliCodeTimerAutoGeneral("",0);
625 
626  if (!AliMUONCDB::CheckMapping()) return 0;
627 
628  Int_t nchannels(0);
629  Int_t nmanus(0);
630 
631  const Int_t kChannels(AliMpConstants::ManuNofChannels());
632 
633  // bending
634  const Float_t kPedestalMeanMeanB(200.);
635  const Float_t kPedestalMeanSigmaB(10.);
636  const Float_t kPedestalSigmaMeanB(1.);
637  const Float_t kPedestalSigmaSigmaB(0.2);
638 
639  // non bending
640  const Float_t kPedestalMeanMeanNB(200.);
641  const Float_t kPedestalMeanSigmaNB(10.);
642  const Float_t kPedestalSigmaMeanNB(1.);
643  const Float_t kPedestalSigmaSigmaNB(0.2);
644 
645  const Float_t kFractionOfDeadManu(0.); // within [0.,1.]
646 
647  Int_t detElemId;
648  Int_t manuId;
649 
651 
652  while ( it.Next(detElemId,manuId) )
653  {
654  // skip a given fraction of manus
655  if (kFractionOfDeadManu > 0. && gRandom->Uniform() < kFractionOfDeadManu) continue;
656 
657  ++nmanus;
658 
659  AliMUONVCalibParam* ped =
660  new AliMUONCalibParamNF(2,kChannels,detElemId,manuId,AliMUONVCalibParam::InvalidFloatValue());
661 
663 
664  for ( Int_t manuChannel = 0; manuChannel < kChannels; ++manuChannel )
665  {
666  if ( ! de->IsConnectedChannel(manuId,manuChannel) ) continue;
667 
668  ++nchannels;
669 
670  Float_t meanPedestal;
671  Float_t sigmaPedestal;
672 
673  if ( defaultValues )
674  {
675  meanPedestal = 0.0;
676  sigmaPedestal = 1.0;
677  }
678  else
679  {
680  Bool_t positive(kTRUE);
681  meanPedestal = 0.0;
682 
683  if ( manuId & AliMpConstants::ManuMask(AliMp::kNonBendingPlane) ) { // manu in non bending plane
684 
685  while ( meanPedestal == 0.0 ) // avoid strict zero
686  {
687  meanPedestal = GetRandom(kPedestalMeanMeanNB,kPedestalMeanSigmaNB,positive);
688  }
689  sigmaPedestal = GetRandom(kPedestalSigmaMeanNB,kPedestalSigmaSigmaNB,positive);
690 
691  } else { // manu in bending plane
692 
693  while ( meanPedestal == 0.0 ) // avoid strict zero
694  {
695  meanPedestal = GetRandom(kPedestalMeanMeanB,kPedestalMeanSigmaB,positive);
696  }
697  sigmaPedestal = GetRandom(kPedestalSigmaMeanB,kPedestalSigmaSigmaB,positive);
698 
699  }
700 
701  }
702 
703  ped->SetValueAsFloat(manuChannel,0,meanPedestal);
704  ped->SetValueAsFloat(manuChannel,1,sigmaPedestal);
705 
706  }
707  Bool_t ok = pedestalStore.Add(ped);
708  if (!ok)
709  {
710  AliErrorGeneral("AliMUONCDB", Form("Could not set DetElemId=%d manuId=%d",detElemId,manuId));
711  }
712  }
713 
714  AliInfoGeneral("AliMUONCDB", Form("%d Manus and %d channels.",nmanus,nchannels));
715  return nchannels;
716 }
717 
718 //_____________________________________________________________________________
720 AliMUONCDB::MakeRejectListStore(Bool_t defaultValues)
721 {
723 
724  AliCodeTimerAutoGeneral("",0);
725 
727 
728  if (!defaultValues)
729  {
732  return rl;
733  }
734 
735  return rl;
736 }
737 
738 //_____________________________________________________________________________
739 Int_t
740 AliMUONCDB::MakeOccupancyMapStore(AliMUONVStore& occupancyMapStore, Bool_t defaultValues)
741 {
743 
744  AliCodeTimerAutoGeneral("",0);
745 
746  if (!AliMUONCDB::CheckMapping()) return 0;
747 
748  Int_t nmanus(0);
749 
750  Int_t detElemId;
751  Int_t manuId;
752 
754 
755  Int_t nevents(1000);
756 
757  while ( it.Next(detElemId,manuId) )
758  {
759  ++nmanus;
760 
761  AliMUONVCalibParam* occupancy = new AliMUONCalibParamND(5,1,detElemId,manuId,0);
762 
763  Double_t occ = 0.0;
764 
766 
767  Int_t numberOfChannelsInManu = de->NofChannelsInManu(manuId);
768 
769  if (!defaultValues) occ = gRandom->Rndm(1);
770 
771  Double_t sumn = occ*nevents;
772 
773  occupancy->SetValueAsFloat(0,0,sumn);
774  occupancy->SetValueAsFloat(0,1,sumn);
775  occupancy->SetValueAsFloat(0,2,sumn);
776  occupancy->SetValueAsInt(0,3,numberOfChannelsInManu);
777  occupancy->SetValueAsInt(0,4,nevents);
778 
779  Bool_t ok = occupancyMapStore.Add(occupancy);
780  if (!ok)
781  {
782  AliErrorGeneral("AliMUONCDB", Form("Could not set DetElemId=%d manuId=%d",detElemId,manuId));
783  }
784  }
785 
786  return nmanus;
787 }
788 
789 //_____________________________________________________________________________
790 Int_t
791 AliMUONCDB::MakeCapacitanceStore(AliMUONVStore& capaStore, const char* file)
792 {
794 
795  if (!AliMUONCDB::CheckMapping()) return 0;
796 
797  return AliMUONTrackerIO::ReadCapacitances(file,capaStore);
798 }
799 
800 //_____________________________________________________________________________
801 Int_t
802 AliMUONCDB::MakeCapacitanceStore(AliMUONVStore& capaStore, Bool_t defaultValues)
803 {
807 
808  AliCodeTimerAutoGeneral("",0);
809 
810  if (!AliMUONCDB::CheckMapping()) return 0;
811 
812  Int_t nchannels(0);
813  Int_t nmanus(0);
814  Int_t nmanusOK(0); // manus for which we got the serial number
815 
816  const Float_t kCapaMean(0.3);
817  const Float_t kCapaSigma(0.1);
818  const Float_t kInjectionGainMean(3);
819  const Float_t kInjectionGainSigma(1);
820 
821  Int_t detElemId;
822  Int_t manuId;
823 
825 
826  while ( it.Next(detElemId,manuId) )
827  {
828  ++nmanus;
829 
831  Int_t serialNumber = AliMpManuStore::Instance()->GetManuSerial(detElemId, manuId);
832 
833  if ( serialNumber <= 0 ) continue;
834 
835  ++nmanusOK;
836 
837  AliMUONVCalibParam* capa = static_cast<AliMUONVCalibParam*>(capaStore.FindObject(serialNumber));
838 
839  if (!capa)
840  {
841  capa = new AliMUONCalibParamNF(2,AliMpConstants::ManuNofChannels(),serialNumber,0,1.0);
842  Bool_t ok = capaStore.Add(capa);
843  if (!ok)
844  {
845  AliErrorGeneral("AliMUONCDB", Form("Could not set serialNumber=%d manuId=%d",serialNumber,manuId));
846  }
847  }
848 
849  for ( Int_t manuChannel = 0; manuChannel < capa->Size(); ++manuChannel )
850  {
851  if ( ! de->IsConnectedChannel(manuId,manuChannel) ) continue;
852 
853  ++nchannels;
854 
855  Float_t capaValue;
856  Float_t injectionGain;
857 
858  if ( defaultValues )
859  {
860  capaValue = 1.0;
861  injectionGain = 1.0;
862  }
863  else
864  {
865  capaValue = GetRandom(kCapaMean,kCapaSigma,kTRUE);
866  injectionGain = GetRandom(kInjectionGainMean,kInjectionGainSigma,kTRUE);
867  }
868  capa->SetValueAsFloat(manuChannel,0,capaValue);
869  capa->SetValueAsFloat(manuChannel,1,injectionGain);
870  }
871  }
872 
873  Float_t percent = 0;
874  if ( nmanus ) percent = 100*nmanusOK/nmanus;
875  AliInfoGeneral("AliMUONCDB", Form("%5d manus with serial number (out of %5d manus = %3.0f%%)",
876  nmanusOK,nmanus,percent));
877  AliInfoGeneral("AliMUONCDB", Form("%5d channels",nchannels));
878  if ( percent < 100 )
879  {
880  AliWarningGeneral("AliMUONCDB", "Did not get all serial numbers. capaStore is incomplete !!!!");
881  }
882  return nchannels;
883 
884 }
885 
886 //_____________________________________________________________________________
887 Int_t
888 AliMUONCDB::MakeGainStore(AliMUONVStore& gainStore, Bool_t defaultValues)
889 {
895 
896  AliCodeTimerAutoGeneral("",0);
897 
898  if (!AliMUONCDB::CheckMapping()) return 0;
899 
900  Int_t nchannels(0);
901  Int_t nmanus(0);
902 
903  const Int_t kSaturation(3000);
904  const Double_t kA0Mean(1.2);
905  const Double_t kA0Sigma(0.1);
906  const Double_t kA1Mean(1E-5);
907  const Double_t kA1Sigma(1E-6);
908  const Double_t kQualMean(0xFF);
909  const Double_t kQualSigma(0x10);
910  const Int_t kThresMean(1600);
911  const Int_t kThresSigma(100);
912 
913  Int_t detElemId;
914  Int_t manuId;
915 
917 
918  while ( it.Next(detElemId,manuId) )
919  {
920  ++nmanus;
921 
922  AliMUONVCalibParam* gain =
924  detElemId,
925  manuId,
927 
929 
930  for ( Int_t manuChannel = 0; manuChannel < gain->Size(); ++manuChannel )
931  {
932  if ( ! de->IsConnectedChannel(manuId,manuChannel) ) continue;
933 
934  ++nchannels;
935 
936  if ( defaultValues )
937  {
938  gain->SetValueAsFloat(manuChannel,0,1.0);
939  gain->SetValueAsFloat(manuChannel,1,0.0);
940  gain->SetValueAsInt(manuChannel,2,4095);
941  gain->SetValueAsInt(manuChannel,3,1);
942  gain->SetValueAsInt(manuChannel,4,kSaturation);
943  }
944  else
945  {
946  Bool_t positive(kTRUE);
947  gain->SetValueAsFloat(manuChannel,0,GetRandom(kA0Mean,kA0Sigma,positive));
948  gain->SetValueAsFloat(manuChannel,1,GetRandom(kA1Mean,kA1Sigma,!positive));
949  gain->SetValueAsInt(manuChannel,2,(Int_t)TMath::Nint(GetRandom(kThresMean,kThresSigma,positive)));
950  gain->SetValueAsInt(manuChannel,3,(Int_t)TMath::Nint(GetRandom(kQualMean,kQualSigma,positive)));
951  gain->SetValueAsInt(manuChannel,4,kSaturation);
952  }
953 
954  }
955  Bool_t ok = gainStore.Add(gain);
956  if (!ok)
957  {
958  AliErrorGeneral("AliMUONCDB", Form("Could not set DetElemId=%d manuId=%d",detElemId,manuId));
959  }
960  }
961 
962  AliInfoGeneral("AliMUONCDB", Form("%d Manus and %d channels.",nmanus,nchannels));
963  return nchannels;
964 }
965 
966 //_____________________________________________________________________________
967 Int_t
969 {
971 
972  AliCodeTimerAutoGeneral("",0);
973 
974  Int_t ngenerated(0);
975  // Generate fake mask values for all localboards and put that into
976  // one single container (localBoardMasks)
977  for ( Int_t i = 1; i <= AliMpConstants::TotalNofLocalBoards(); ++i )
978  {
979  AliMUONVCalibParam* localBoard = new AliMUONCalibParamNI(1,8,i,0,0);
980  for ( Int_t x = 0; x < 2; ++x )
981  {
982  for ( Int_t y = 0; y < 4; ++y )
983  {
984  Int_t index = x*4+y;
985  localBoard->SetValueAsInt(index,0,0xFFFF);
986  ++ngenerated;
987  }
988  }
989  localBoardMasks.Add(localBoard);
990  }
991  return ngenerated;
992 }
993 
994 //_____________________________________________________________________________
995 Int_t
997 {
999 
1000  AliCodeTimerAutoGeneral("",0);
1001 
1003  AliErrorGeneral("AliMUONCDB", "Error when reading from mapping file");
1004  return 0;
1005  }
1006 
1007  return rtm.GetNofTriggerCrates();
1008 }
1009 
1010 
1011 //_____________________________________________________________________________
1012 Int_t
1014 {
1016 
1017  AliCodeTimerAutoGeneral("",0);
1018 
1020 }
1021 
1022 
1023 //_____________________________________________________________________________
1026 {
1028 
1029  AliCodeTimerAutoGeneral("",0);
1030 
1032  lut->ReadFromFile(file);
1033  return lut;
1034 }
1035 
1036 //_____________________________________________________________________________
1039 {
1041 
1042  AliCodeTimerAutoGeneral("",0);
1043 
1044  return new AliMUONTriggerEfficiencyCells(file);
1045 }
1046 
1047 //_____________________________________________________________________________
1048 void
1049 AliMUONCDB::WriteToCDB(const char* calibpath, TObject* object,
1050  Int_t startRun, Int_t endRun,
1051  const char* filename)
1052 {
1054 
1055  TString comment(gSystem->ExpandPathName(filename));
1056 
1057  WriteToCDB(object, calibpath, startRun, endRun, comment.Data());
1058 }
1059 
1060 //_____________________________________________________________________________
1061 void
1062 AliMUONCDB::WriteToCDB(const char* calibpath, TObject* object,
1063  Int_t startRun, Int_t endRun, Bool_t defaultValues)
1064 {
1066 
1067  TString comment;
1068  if ( defaultValues ) comment += "Test with default values";
1069  else comment += "Test with random values";
1070 
1071  WriteToCDB(object, calibpath, startRun, endRun, comment.Data());
1072 }
1073 
1074 //_____________________________________________________________________________
1075 void
1076 AliMUONCDB::WriteToCDB(TObject* object, const char* calibpath, Int_t startRun, Int_t endRun,
1077  const char* comment, const char* responsible)
1078 {
1080 
1081  if (!AliMUONCDB::CheckOCDB(kTRUE)) return;
1082 
1083  AliCDBId id(calibpath,startRun,endRun);
1084  AliCDBMetaData md;
1085  md.SetAliRootVersion(gROOT->GetVersion());
1086  md.SetComment(comment);
1087  md.SetResponsible(responsible);
1088  AliCDBManager::Instance()->Put(object,id,&md);
1089 }
1090 
1091 //_____________________________________________________________________________
1092 void
1093 AliMUONCDB::WriteLocalTriggerMasks(Int_t startRun, Int_t endRun)
1094 {
1096 
1098  Int_t ngenerated = MakeLocalTriggerMaskStore(*ltm);
1099  AliInfoGeneral("AliMUONCDB", Form("Ngenerated = %d",ngenerated));
1100  if (ngenerated>0)
1101  {
1102  WriteToCDB("MUON/Calib/LocalTriggerBoardMasks",ltm,startRun,endRun,true);
1103  }
1104  delete ltm;
1105 }
1106 
1107 //_____________________________________________________________________________
1108 void
1109 AliMUONCDB::WriteRegionalTriggerConfig(Int_t startRun, Int_t endRun)
1110 {
1112 
1114  Int_t ngenerated = MakeRegionalTriggerConfigStore(*rtm);
1115  AliInfoGeneral("AliMUONCDB", Form("Ngenerated = %d",ngenerated));
1116  if (ngenerated>0)
1117  {
1118  WriteToCDB("MUON/Calib/RegionalTriggerConfig",rtm,startRun,endRun,true);
1119  }
1120  delete rtm;
1121 }
1122 
1123 
1124 //_____________________________________________________________________________
1125 void
1126 AliMUONCDB::WriteGlobalTriggerConfig(Int_t startRun, Int_t endRun)
1127 {
1129 
1131 
1132  Int_t ngenerated = MakeGlobalTriggerConfigStore(*gtm);
1133  AliInfoGeneral("AliMUONCDB", Form("Ngenerated = %d",ngenerated));
1134  if (ngenerated>0)
1135  {
1136  WriteToCDB("MUON/Calib/GlobalTriggerCrateConfig",gtm,startRun,endRun,true);
1137  }
1138  delete gtm;
1139 }
1140 
1141 
1142 //_____________________________________________________________________________
1143 void
1144 AliMUONCDB::WriteTriggerLut(Int_t startRun, Int_t endRun)
1145 {
1147 
1149  if (lut)
1150  {
1151  WriteToCDB("MUON/Calib/TriggerLut",lut,startRun,endRun,true);
1152  }
1153  delete lut;
1154 }
1155 
1156 //_____________________________________________________________________________
1157 void
1158 AliMUONCDB::WriteTriggerEfficiency(Int_t startRun, Int_t endRun)
1159 {
1161 
1163  if (eff)
1164  {
1165  WriteToCDB("MUON/Calib/TriggerEfficiency",eff,startRun,endRun,true);
1166  }
1167  delete eff;
1168 }
1169 
1170 //_____________________________________________________________________________
1171 void
1172 AliMUONCDB::WriteHV(Bool_t defaultValues,
1173  Int_t startRun, Int_t endRun)
1174 {
1179 
1180  TMap* hvStore = new TMap;
1181  Int_t ngenerated = MakeHVStore(*hvStore,defaultValues);
1182  AliInfoGeneral("AliMUONCDB", Form("Ngenerated = %d",ngenerated));
1183  if (ngenerated>0)
1184  {
1185  WriteToCDB("MUON/Calib/HV",hvStore,startRun,endRun,defaultValues);
1186  }
1187  delete hvStore;
1188 }
1189 
1190 //_____________________________________________________________________________
1191 void
1192 AliMUONCDB::WriteTriggerDCS(Bool_t defaultValues,
1193  Int_t startRun, Int_t endRun)
1194 {
1199 
1200  TMap* triggerDCSStore = new TMap;
1201  Int_t ngenerated = MakeTriggerDCSStore(*triggerDCSStore,defaultValues);
1202  AliInfoGeneral("AliMUONCDB", Form("Ngenerated = %d",ngenerated));
1203  if (ngenerated>0)
1204  {
1205  WriteToCDB("MUON/Calib/TriggerDCS",triggerDCSStore,startRun,endRun,defaultValues);
1206  }
1207  delete triggerDCSStore;
1208 }
1209 
1210 //_____________________________________________________________________________
1211 void
1212 AliMUONCDB::WritePedestals(Bool_t defaultValues,
1213  Int_t startRun, Int_t endRun)
1214 {
1219 
1220  AliMUONVStore* pedestalStore = Create2DMap();
1221  Int_t ngenerated = MakePedestalStore(*pedestalStore,defaultValues);
1222  AliInfoGeneral("AliMUONCDB", Form("Ngenerated = %d",ngenerated));
1223  WriteToCDB("MUON/Calib/Pedestals",pedestalStore,startRun,endRun,defaultValues);
1224  delete pedestalStore;
1225 }
1226 
1227 //_____________________________________________________________________________
1228 void
1229 AliMUONCDB::WriteOccupancyMap(Bool_t defaultValues,
1230  Int_t startRun, Int_t endRun)
1231 {
1236 
1237  AliMUONVStore* occupancyMapStore = Create2DMap();
1238  Int_t ngenerated = MakeOccupancyMapStore(*occupancyMapStore,defaultValues);
1239  AliInfoGeneral("AliMUONCDB", Form("Ngenerated = %d",ngenerated));
1240  WriteToCDB("MUON/Calib/OccupancyMap",occupancyMapStore,startRun,endRun,defaultValues);
1241  delete occupancyMapStore;
1242 }
1243 
1244 //_____________________________________________________________________________
1245 void
1246 AliMUONCDB::WriteRejectList(Bool_t defaultValues,
1247  Int_t startRun, Int_t endRun)
1248 {
1253 
1254  AliMUONRejectList* rl = MakeRejectListStore(defaultValues);
1255  WriteToCDB("MUON/Calib/RejectList",rl,startRun,endRun,defaultValues);
1256  delete rl;
1257 }
1258 
1259 
1260 //_____________________________________________________________________________
1261 void
1262 AliMUONCDB::WriteGains(Bool_t defaultValues,
1263  Int_t startRun, Int_t endRun)
1264 {
1269 
1270  AliMUONVStore* gainStore = Create2DMap();
1271  Int_t ngenerated = MakeGainStore(*gainStore,defaultValues);
1272  AliInfoGeneral("AliMUONCDB", Form("Ngenerated = %d",ngenerated));
1273  WriteToCDB("MUON/Calib/Gains",gainStore,startRun,endRun,defaultValues);
1274  delete gainStore;
1275 }
1276 
1277 //_____________________________________________________________________________
1278 void
1279 AliMUONCDB::WriteCapacitances(const char* filename,
1280  Int_t startRun, Int_t endRun)
1281 {
1285 
1286  AliMUONVStore* capaStore = new AliMUON1DMap(16828);
1287  Int_t ngenerated = MakeCapacitanceStore(*capaStore,filename);
1288  AliInfoGeneral("AliMUONCDB", Form("Ngenerated = %d",ngenerated));
1289  if ( ngenerated > 0 )
1290  {
1291  WriteToCDB("MUON/Calib/Capacitances",capaStore,startRun,endRun,filename);
1292  }
1293  delete capaStore;
1294 }
1295 
1296 //_____________________________________________________________________________
1297 void
1298 AliMUONCDB::WriteCapacitances(Bool_t defaultValues,
1299  Int_t startRun, Int_t endRun)
1300 {
1305 
1306  AliMUONVStore* capaStore = new AliMUON1DMap(16828);
1307  Int_t ngenerated = MakeCapacitanceStore(*capaStore,defaultValues);
1308  AliInfoGeneral("AliMUONCDB", Form("Ngenerated = %d",ngenerated));
1309  WriteToCDB("MUON/Calib/Capacitances",capaStore,startRun,endRun,defaultValues);
1310  delete capaStore;
1311 }
1312 
1313 //_____________________________________________________________________________
1314 void
1315 AliMUONCDB::WriteTrigger(Bool_t defaultValues, Int_t startRun, Int_t endRun)
1316 {
1318  WriteTriggerDCS(defaultValues,startRun,endRun);
1319  WriteLocalTriggerMasks(startRun,endRun);
1320  WriteRegionalTriggerConfig(startRun,endRun);
1321  WriteGlobalTriggerConfig(startRun,endRun);
1322  WriteTriggerLut(startRun,endRun);
1323  WriteTriggerEfficiency(startRun,endRun);
1324 }
1325 
1326 //_____________________________________________________________________________
1327 void
1328 AliMUONCDB::WriteConfig(Int_t startRun, Int_t endRun)
1329 {
1331  ostringstream lines;
1332  TIter next(AliMpDDLStore::Instance()->CreateBusPatchIterator());
1333  AliMpBusPatch* bp;
1334  while ( ( bp = static_cast<AliMpBusPatch*>(next()) ) )
1335  {
1336  for (Int_t imanu = 0; imanu < bp->GetNofManus(); ++imanu)
1337  {
1338  lines << bp->GetId() << " " << bp->GetManuId(imanu) << endl;
1339  }
1340  }
1341 
1342  AliMUON2DMap config(kTRUE);
1343 
1344  AliMUONTrackerIO::DecodeConfig(lines.str().c_str(),config);
1345 
1346  WriteToCDB("MUON/Calib/Config",&config,startRun,endRun,kTRUE);
1347 }
1348 
1349 //_____________________________________________________________________________
1350 void
1351 AliMUONCDB::WriteTracker(Bool_t defaultValues, Int_t startRun, Int_t endRun)
1352 {
1354  WriteHV(defaultValues,startRun,endRun);
1355  WritePedestals(defaultValues,startRun,endRun);
1356  WriteGains(defaultValues,startRun,endRun);
1357  WriteCapacitances(defaultValues,startRun,endRun);
1358  WriteOccupancyMap(defaultValues,startRun,endRun);
1359  WriteRejectList(defaultValues,startRun,endRun);
1360  WriteConfig(startRun,endRun);
1361 }
1362 
1363 //_____________________________________________________________________________
1364 void
1366 {
1370 
1371  if (!AliMUONCDB::CheckOCDB()) return;
1372 
1374 
1375  if (!AliMUONCDB::CheckMapping()) return;
1376 
1377  AliCDBEntry* e = AliCDBManager::Instance()->Get("MUON/Calib/Config");
1378 
1379  if (!e) return ;
1380 
1381  AliMUONVStore* config = static_cast<AliMUONVStore*>(e->GetObject());
1382 
1383  e = AliCDBManager::Instance()->Get("MUON/Calib/Capacitances");
1384 
1385  if (!e) return;
1386 
1387  AliMUONVStore* capacitances = static_cast<AliMUONVStore*>(e->GetObject());
1388 
1389  AliInfoGeneral("ShowCapacitances",Form("%d capacitances are in OCDB",capacitances->GetSize()));
1390 
1391  TIter nextManu(config->CreateIterator());
1392  AliMUONVCalibParam* param;
1393 
1394  while ( ( param = static_cast<AliMUONVCalibParam*>(nextManu()) ) )
1395  {
1396  Int_t detElemId = param->ID0();
1397  Int_t manuId = param->ID1();
1398 
1399  Int_t serialNumber
1400  = AliMpManuStore::Instance()->GetManuSerial(detElemId, manuId);
1401 
1402  if (serialNumber<0)
1403  {
1404  AliErrorGeneral("ShowCapacitances",Form("Did not find serial for DE %04d MANUID %04d",detElemId,manuId));
1405  }
1406  else
1407  {
1408  AliMUONVCalibParam* capa = static_cast<AliMUONVCalibParam*>(capacitances->FindObject(serialNumber));
1409  if (!capa)
1410  {
1411  AliErrorGeneral("ShowCapacitances",Form("Did not find capacitance for DE %04d MANUID %04d SERIAL %d",detElemId,manuId,serialNumber));
1412  }
1413  }
1414  }
1415 
1416 }
1417 
1418 //_____________________________________________________________________________
1419 void
1420 AliMUONCDB::ShowConfig(Bool_t withStatusMap)
1421 {
1425 
1426  if (!AliMUONCDB::CheckOCDB()) return;
1427 
1429 
1430  if (!AliMUONCDB::CheckMapping()) return;
1431 
1432  AliCDBEntry* e = AliCDBManager::Instance()->Get("MUON/Calib/Config");
1433 
1434  if (!e) return ;
1435 
1436  AliMUONVStore* config = static_cast<AliMUONVStore*>(e->GetObject());
1437 
1438  AliMUONPadStatusMapMaker* statusMapMaker(0x0);
1439  AliMUONCalibrationData* cd(0x0);
1440  AliMUONPadStatusMaker* statusMaker(0x0);
1441 
1442  if ( withStatusMap )
1443  {
1444  cd = new AliMUONCalibrationData(AliCDBManager::Instance()->GetRun());
1445 
1446  statusMaker = new AliMUONPadStatusMaker(*cd);
1447 
1449 
1450  if (!recoParam)
1451  {
1452  AliErrorGeneral("AliMUONCDB::ShowConfig","Cannot get recoParams from OCDB !");
1453  return;
1454  }
1455 
1456  statusMaker->SetLimits(*recoParam);
1457 
1458  UInt_t mask = recoParam->PadGoodnessMask();
1459 
1460  delete recoParam;
1461 
1462  const Bool_t deferredInitialization = kFALSE;
1463 
1464  statusMapMaker = new AliMUONPadStatusMapMaker(*cd,mask,deferredInitialization);
1465  }
1466 
1467  TIter nextManu(config->CreateIterator());
1468  AliMUONVCalibParam* param;
1469 
1470  AliMpExMap buspatches;
1471 
1472  while ( ( param = static_cast<AliMUONVCalibParam*>(nextManu()) ) )
1473  {
1474  Int_t detElemId = param->ID0();
1475  Int_t manuId = param->ID1();
1476  Int_t busPatchId = AliMpDDLStore::Instance()->GetBusPatchId(detElemId,manuId);
1477  if ( buspatches.GetValue(busPatchId) == 0x0 )
1478  {
1479  buspatches.Add(busPatchId,new TObjString(Form("BP%04d",busPatchId)));
1480  }
1481  }
1482 
1483  TArrayI removed(buspatches.GetSize());
1484 
1485  TIter next(AliMpDDLStore::Instance()->CreateBusPatchIterator());
1486  AliMpBusPatch* bp;
1487  Int_t n(0);
1488  Int_t nok(0);
1489  Int_t nremoved(0);
1490 
1491  // accounting of bus patches first
1492 
1493  while ( ( bp = static_cast<AliMpBusPatch*>(next())))
1494  {
1495  if ( buspatches.GetValue(bp->GetId()) )
1496  {
1497  ++nok;
1498  }
1499  else
1500  {
1501  removed.SetAt(bp->GetId(),nremoved++);
1502  }
1503  }
1504 
1505  // accounting of channels
1506 
1507  AliMpManuIterator it;
1508 
1509  Int_t totalNumberOfChannels(0);
1510  Int_t removedChannels(0);
1511  Int_t badChannels(0);
1512  Int_t badAndRemovedChannels(0);
1513  Int_t badOrRemovedChannels(0);
1514 
1515  Int_t detElemId, manuId;
1516 
1517  while ( it.Next(detElemId,manuId) )
1518  {
1520  for ( Int_t i = 0; i < AliMpConstants::ManuNofChannels(); ++i )
1521  {
1522  Int_t busPatchId = AliMpDDLStore::Instance()->GetBusPatchId(detElemId,manuId);
1523 
1524  if ( de->IsConnectedChannel(manuId,i) )
1525  {
1526  ++totalNumberOfChannels;
1527  Bool_t badBusPatch = ( buspatches.GetValue(busPatchId) == 0x0 );
1528 
1529  if ( withStatusMap )
1530  {
1531  Bool_t badChannel = ( ( statusMapMaker->StatusMap(detElemId,manuId,i) & AliMUONPadStatusMapMaker::SelfDeadMask() ) != 0);
1532  if ( badChannel ) ++badChannels;
1533  if ( badBusPatch && badChannel ) ++badAndRemovedChannels;
1534  if ( badBusPatch || badChannel ) ++badOrRemovedChannels;
1535  }
1536 
1537  if ( badBusPatch) ++removedChannels;
1538  }
1539  }
1540  }
1541 
1542 
1543  Int_t* indices = new Int_t[nremoved];
1544 
1545  TMath::Sort(nremoved,removed.GetArray(),indices,kFALSE);
1546 
1547  for ( Int_t i = 0; i < nremoved; ++i )
1548  {
1549  Int_t busPatchId = removed[indices[i]];
1550  bp = AliMpDDLStore::Instance()->GetBusPatch(busPatchId);
1551  bp->Print();
1552  }
1553 
1554  delete[] indices;
1555 
1556  cout << endl;
1557  cout << Form("Bus patches n=%3d nok=%3d nremoved=%3d",n,nok,nremoved) << endl;
1558 
1559  cout << Form("Channels n=%6d nremoved=%6d bad=%6d bad and removed=%6d bad or removed=%6d",
1560  totalNumberOfChannels,removedChannels,badChannels,badAndRemovedChannels,badOrRemovedChannels) << endl;
1561 
1562  if (totalNumberOfChannels>0)
1563  {
1564  cout << Form("Percentage of readout channels %5.1f %%",removedChannels*100.0/totalNumberOfChannels) << endl;
1565  if ( withStatusMap )
1566  {
1567  cout << Form("Percentage of non useable channels (bad or removed) %5.1f %%",
1568  badOrRemovedChannels*100.0/totalNumberOfChannels) << endl;
1569  }
1570  }
1571 
1572 
1573  delete statusMapMaker;
1574  delete cd;
1575  delete statusMaker;
1576 }
1577 
1578 //______________________________________________________________________________
1579 void AliMUONCDB::ReadIntegers(const char* filename, std::vector<int>& integers)
1580 {
1583  ifstream in(gSystem->ExpandPathName(filename));
1584  int i;
1585 
1586  std::set<int> runset;
1587 
1588  char line[10000];
1589 
1590  in.getline(line,10000,'\n');
1591 
1592  TString sline(line);
1593 
1594  if (sline.Contains(","))
1595  {
1596  TObjArray* a = sline.Tokenize(",");
1597  TIter next(a);
1598  TObjString* s;
1599  while ( ( s = static_cast<TObjString*>(next()) ) )
1600  {
1601  runset.insert(s->String().Atoi());
1602  }
1603  delete a;
1604  }
1605  else
1606  {
1607  runset.insert(sline.Atoi());
1608 
1609  while ( in >> i )
1610  {
1611  runset.insert(i);
1612  }
1613  }
1614 
1615  for ( std::set<int>::const_iterator it = runset.begin(); it != runset.end(); ++it )
1616  {
1617  integers.push_back((*it));
1618  }
1619 
1620  std::sort(integers.begin(),integers.end());
1621 }
1622 
1623 //______________________________________________________________________________
1624 void AliMUONCDB::ShowFaultyBusPatches(const char* runlist, double occLimit,
1625  const char* outputBaseName,
1626  const char* ocdbPath)
1627 {
1630 
1631  AliLog::GetRootLogger()->SetGlobalLogLevel(AliLog::kError);
1632 
1633  // AliLog::SetPrintType(AliLog::kInfo,kFALSE);
1634  // AliLog::SetPrintType(AliLog::kWarning,kFALSE);
1635  // gErrorIgnoreLevel=kError; // to avoid all the TAlienFile::Open messages...
1636 
1637  AliCDBManager* man = AliCDBManager::Instance();
1638 
1639  man->SetDefaultStorage(ocdbPath);
1640 
1641  Bool_t first(kTRUE);
1642 
1643  std::vector<int> runnumbers;
1644 
1645  ReadIntegers(runlist,runnumbers);
1646 
1647  AliMUON2DMap bpValues(kFALSE);
1648 
1649  std::ofstream outfile(Form("%s.txt",outputBaseName));
1650 
1651  for ( unsigned int i = 0 ; i < runnumbers.size(); ++i )
1652  {
1653  int runNumber = runnumbers[i];
1654 
1655  man->SetRun(runNumber);
1656 
1657  if ( first )
1658  {
1659  AliMpCDB::LoadAll();
1660  first = kFALSE;
1661  }
1662 
1663  AliCDBEntry* e = man->Get("MUON/Calib/OccupancyMap",runNumber);
1664 
1665  if (!e)
1666  {
1667  AliErrorGeneral("AliMUONCDB::ShowFaultyBusPatches",
1668  Form("Could not get OccupancyMap for run %09d",runNumber));
1669  continue;
1670  }
1671 
1672  AliMUONVStore* occmap = static_cast<AliMUONVStore*>(e->GetObject());
1673 
1674  AliMUONTrackerData td("occ","occ",*occmap);
1675 
1676  TIter nextBP(AliMpDDLStore::Instance()->CreateBusPatchIterator());
1677  AliMpBusPatch* bp;
1678  std::set<int> buspatches;
1679  Double_t sumn = 1000.0;
1680 
1681  while ( ( bp = static_cast<AliMpBusPatch*>(nextBP()) ) )
1682  {
1683  Double_t occ = td.BusPatch(bp->GetId(),2);
1684 
1685  if (occ>occLimit)
1686  {
1687  buspatches.insert(bp->GetId());
1688 
1689  AliMUONVCalibParam* param = static_cast<AliMUONVCalibParam*>(bpValues.FindObject(bp->GetId()));
1690 
1691  if (!param)
1692  {
1693  param = new AliMUONCalibParamND(5, 1, bp->GetId(), 0);
1694  bpValues.Add(param);
1695 
1696  Int_t detElemId = AliMpDDLStore::Instance()->GetDEfromBus(bp->GetId());
1698 
1699  Int_t nchannels(0);
1700 
1701  for ( Int_t imanu = 0; imanu < bp->GetNofManus(); ++imanu )
1702  {
1703  Int_t manuId = bp->GetManuId(imanu);
1704  nchannels += de->NofChannelsInManu(manuId);
1705  }
1706 
1707  param->SetValueAsDouble(0,2,sumn);
1708  param->SetValueAsDouble(0,3,nchannels);
1709  param->SetValueAsDouble(0,4,1);
1710  }
1711 
1712  Double_t sumw = sumn*(param->ValueAsDouble(0)/sumn+1.0/runnumbers.size());
1713  Double_t sumw2 = 0.0; //(sumn-1)*ey*ey+sumw*sumw/sumn;
1714 
1715  param->SetValueAsDouble(0,0,sumw);
1716  param->SetValueAsDouble(0,1,sumw2);
1717 
1718  }
1719  }
1720 
1721  outfile << Form("RUN %09d",runNumber);
1722 
1723  for ( std::set<int>::const_iterator bit = buspatches.begin(); bit != buspatches.end(); ++bit )
1724  {
1725  outfile << Form(" %4d",*bit);
1726  }
1727  outfile << endl;
1728  }
1729 
1730  outfile.close();
1731 
1732  if ( bpValues.GetSize() == 0 )
1733  {
1734  cout << Form("Great. No faulty bus patch (at the %g occupancy limit) found.",occLimit) << endl;
1735  gSystem->Exec(Form("rm %s.txt",outputBaseName));
1736  }
1737  else
1738  {
1739  const char* name = "BPfailureRate";
1740 
1741  AliMUONTrackerData* mpData = new AliMUONTrackerData(name,name,bpValues,2);
1742  mpData->SetDimensionName(0,name);
1743 
1744  TFile f(Form("%s.root",outputBaseName),"recreate");
1745  mpData->Write();
1746  f.Close();
1747 
1748  cout << Form("Results are in %s.txt and %s.root",outputBaseName,outputBaseName) << endl;
1749 
1750  gSystem->Exec(Form("cat %s.txt",outputBaseName));
1751  }
1752 }
1753 
1754 //______________________________________________________________________________
1755 Double_t AliMUONCDB::MeanHVValueForDCSAlias(TMap& hvMap, const char* hvChannel)
1756 {
1757 
1758  TPair* hvPair = static_cast<TPair*>(hvMap.FindObject(hvChannel));
1759  if (!hvPair)
1760  {
1761  AliErrorGeneral("AliMUONCDB::MeanHVValueForDCSAlias",Form("Did not find expected alias (%s)",hvChannel));
1762  return 0.0;
1763  }
1764  else
1765  {
1766  TObjArray* values = static_cast<TObjArray*>(hvPair->Value());
1767  if (!values)
1768  {
1769  AliErrorGeneral("AliMUONCDB::MeanHVValueForDCSAlias",Form("Could not get values for alias %s",hvChannel));
1770  return 0.0;
1771  }
1772  else
1773  {
1774  // find out min value, and makes a cut
1775  Float_t hv(0.0);
1776  Float_t n(0.0);
1777  TIter next(values);
1778  AliDCSValue* val;
1779 
1780  while ( ( val = static_cast<AliDCSValue*>(next()) ) )
1781  {
1782  hv += val->GetFloat();
1783  n += 1.0;
1784  }
1785 
1786  if (n>0.0)
1787  {
1788  hv /= n;
1789  return hv;
1790  }
1791  }
1792  return 0.0;
1793  }
1794 }
1795 
1796 //______________________________________________________________________________
1797 void AliMUONCDB::CheckHV(Int_t runNumber, Int_t verbose)
1798 {
1800 
1801  TList messages;
1802  messages.SetOwner(kTRUE);
1803 
1804  Bool_t patched(kTRUE);
1805 
1806  if (!AliCDBManager::Instance()->IsDefaultStorageSet())
1807  {
1808  AliCDBManager::Instance()->SetDefaultStorage("raw://");
1809  }
1810 
1811  AliCDBManager::Instance()->SetRun(runNumber);
1812 
1813  LoadMapping();
1814 
1815  AliMUONCalibrationData::CreateHV(runNumber,0,patched,&messages);
1816 
1817  AliMUONCalibrationData cd(runNumber,true);
1818 
1819  AliMUONPadStatusMaker statusMaker(cd);
1820 
1822 
1823  if (!rp)
1824  {
1825  AliErrorGeneral("AliMUONCDB::CheckHV","Could not get RecoParam !!!");
1826  return;
1827  }
1828 
1829  statusMaker.SetLimits(*rp);
1830 
1831  TIter next(&messages);
1832  TObjString* s;
1833  AliMpDCSNamer hvNamer("TRACKER");
1834  AliMUONLogger log;
1835  Double_t meanHVValue(0.0);
1836  Double_t nofHVValues(0.0);
1837 
1838  while ( ( s = static_cast<TObjString*>(next()) ) )
1839  {
1840  TObjArray* a = s->String().Tokenize(":");
1841 
1842  TString name(static_cast<TObjString*>(a->At(0))->String());
1843 
1844  TObjArray* b = name.Tokenize(" ");
1845 
1846  name = static_cast<TObjString*>(b->At(0))->String();
1847 
1848  delete a;
1849  delete b;
1850 
1851  if ( name.Contains("sw") || name.Contains("SUMMARY") ) {continue;}
1852 
1853  Int_t index = hvNamer.DCSIndexFromDCSAlias(name.Data());
1854 
1855  Int_t detElemId = hvNamer.DetElemIdFromDCSAlias(name.Data());
1856 
1858 
1859  if (!de)
1860  {
1861  AliErrorGeneral("AliMUONCDB::CheckHV",Form("Could not get detElemId from dcsAlias %s",name.Data()));
1862  continue;
1863  }
1864 
1865  Int_t manuId;
1866 
1867  if ( index >= 0 )
1868  {
1869  const AliMpArrayI* array = de->ManusForHV(index);
1870  manuId = array->GetValue(0);
1871  }
1872  else
1873 
1874  {
1876  manuId = bp->GetManuId(0);
1877  }
1878 
1879  Int_t status = statusMaker.HVStatus(detElemId,manuId);
1880 
1881  log.Log(AliMUONPadStatusMaker::AsString(status).Data());
1882 
1883  meanHVValue += MeanHVValueForDCSAlias((*cd.HV()),name.Data());
1884 
1885  nofHVValues += 1.0;
1886 
1887  s->String() += Form(" (DE %4d) ",detElemId);
1888  s->String() += AliMUONPadStatusMaker::AsString(status).Data();
1889  }
1890 
1891  TIter nextMessage(&messages);
1892  TObjString* msg;
1893 
1894  while ( ( msg = static_cast<TObjString*>(nextMessage()) ) )
1895  {
1896  if ( verbose > 0 || msg->String().Contains("SUMMARY") )
1897  {
1898  AliInfoGeneral("AliMUONCDB::CheckHV",Form("RUN %09d HVchannel %s",runNumber,msg->String().Data()));
1899  }
1900  }
1901 
1902  TString lmsg;
1903  Int_t occurance;
1904  TString totalLog;
1905 
1906  while (log.Next(lmsg,occurance))
1907  {
1908  totalLog += Form("%s(%d)",lmsg.Data(),occurance);
1909  totalLog += " | ";
1910  }
1911 
1912  AliInfoGeneral("AliMUONCDB::CheckHV",Form("RUN %09d %s",runNumber,totalLog.Data()));
1913 
1914  // one last loop to get the list of problematic HV channels
1915  nextMessage.Reset();
1916 
1917  while ( ( msg = static_cast<TObjString*>(nextMessage()) ) )
1918  {
1919  if ( msg->String().Contains("HV ") )
1920  {
1921  AliInfoGeneral("AliMUONCDB::CheckHV",Form(" Problem at %s",msg->String().Data()));
1922  }
1923  }
1924 
1925  if (nofHVValues)
1926  {
1927  meanHVValue /= nofHVValues;
1928  AliInfoGeneral("AliMUONCDB::CheckHV",Form("Mean HV for run %09d was %7.2f",runNumber,meanHVValue));
1929  }
1930 
1931  AliCDBManager::Instance()->ClearCache();
1932 }
1933 
1934 
Int_t GetNofManus() const
Convert a pad status container into a pad status map container.
virtual TIterator * CreateIterator() const =0
Return an iterator to loop over the whole store.
Int_t MakeTriggerDCSStore(TMap &aliasMap, Bool_t defaultValues)
Definition: AliMUONCDB.cxx:560
Implementation of AliMUONVTrackerData.
The class defines the configuration of global crate.
static Float_t InvalidFloatValue()
Return 1E38 as invalid float value.
void WritePedestals(Bool_t defaultValues, Int_t startRun, Int_t endRun=AliCDBRunRange::Infinity())
void WriteHV(Bool_t defaultValues, Int_t startRun, Int_t endRun=AliCDBRunRange::Infinity())
AliMUONRejectList * MakeRejectListStore(Bool_t defaultValues)
Definition: AliMUONCDB.cxx:720
static AliMpDEStore * Instance(Bool_t warn=true)
void WriteTriggerEfficiency(Int_t startRun=0, Int_t endRun=AliCDBRunRange::Infinity())
void WriteTriggerLut(Int_t startRun=0, Int_t endRun=AliCDBRunRange::Infinity())
AliMUONTriggerLut * MakeTriggerLUT(const char *file="$(ALICE_ROOT)/MUON/data/lutAptLpt1Hpt1p7.root")
static TString AsString(Int_t status)
static AliMpSegmentation * Instance(Bool_t warn=true)
virtual Float_t ValueAsFloat(Int_t i, Int_t j=0) const =0
TMap * HV(Bool_t patched=kTRUE) const
Get the HV values. Use patched=kFALSE to get unprocessed (i.e. "raw") values as they are in the OCDB...
#define TObjArray
Implementation of AliMUONVCalibParam for tuples of floats.
virtual Int_t Size() const =0
The number of channels handled by this object.
virtual void SetValueAsFloat(Int_t i, Int_t j, Float_t value)=0
Set one value, for channel i, dimension j. Consider value is a float.
void WriteGains(Bool_t defaultValues, Int_t startRun, Int_t endRun=AliCDBRunRange::Infinity())
void CheckHV(Int_t runNumber, Int_t verbose=0)
TClonesArray * LoadAlignmentData()
Definition: AliMUONCDB.cxx:327
static TString comment
Definition: ConfigCosmic.C:131
TFile f("CalibObjects.root")
virtual Double_t BusPatch(Int_t busPatchId, Int_t dim=0) const
Get the value for a given buspatch and given dimension.
Int_t Log(const char *message)
virtual Int_t GetSize() const =0
The number of objects stored.
Int_t GetDEfromBus(Int_t busPatchId) const
Store and give access to the trigger chamber efficiency.
TROOT * gROOT
Int_t MakeLocalTriggerMaskStore(AliMUONVStore &ltm)
Definition: AliMUONCDB.cxx:968
Collection of methods usefull to DCS handling for MUON TRK and TRG.
Definition: AliMpDCSNamer.h:21
void WriteGlobalTriggerConfig(Int_t startRun=0, Int_t endRun=AliCDBRunRange::Infinity())
Int_t MakePedestalStore(AliMUONVStore &pedestalStore, Bool_t defaultValues)
Definition: AliMUONCDB.cxx:618
const AliMpVSegmentation * GetMpSegmentationByElectronics(Int_t detElemId, Int_t elCardID, Bool_t warn=true) const
virtual void SetDimensionName(Int_t index, const char *value)
Set the name of a given dimension.
static Int_t DecodeConfig(const char *data, AliMUONVStore &confStore)
virtual void SetValueAsInt(Int_t i, Int_t j, Int_t value)=0
Set one value, for channel i, dimension j. Consider value is an integer.
Class with MUON reconstruction parameters.
AliMpDetElement * GetDetElement(Int_t detElemId, Bool_t warn=true) const
virtual Double_t ValueAsDouble(Int_t i, Int_t j=0) const
Int_t GetManuId(Int_t index) const
static AliMpManuStore * Instance(Bool_t warn=true)
The class defines the electronics properties of detection element.
TObjArray * GenerateAliases() const
High Voltage.
Definition: AliMpDCSNamer.h:68
void WriteTriggerDCS(Bool_t defaultValues, Int_t startRun, Int_t endRun=AliCDBRunRange::Infinity())
Bool_t Next(TString &msg, Int_t &occurance)
Bool_t LoadField()
Definition: AliMUONCDB.cxx:233
Bool_t Next(Int_t &detElemId, Int_t &manuId)
Class to loop over all manus of MUON Tracker.
TObjArray * array
Definition: AnalyzeLaser.C:12
static TString LocalTriggerBoardMapping()
Definition: AliMpFiles.cxx:337
Int_t GetSize() const
Definition: AliMpExMap.cxx:339
void ShowFaultyBusPatches(const char *runlist, double occLimit=0.1, const char *outputBaseName="faulty.buspatches", const char *ocdbPath="raw://")
static Int_t ReadCapacitances(const char *filename, AliMUONVStore &capaStore)
void SetDetectionElementProbability(Int_t detElemId, Float_t proba=1.0)
A logger that keeps track of the number of times a message appeared.
Definition: AliMUONLogger.h:29
Container of calibration values for a given number of channels.
static AliMpDDLStore * Instance(Bool_t warn=true)
static Int_t GetChamberId(Int_t detElemId, Bool_t warn=true)
AliMUONVStore * StatusMap() const
static Int_t ManuNofChannels()
Max number of channels per manu.
Int_t MakeGainStore(AliMUONVStore &gainStore, Bool_t defaultValues)
Definition: AliMUONCDB.cxx:888
AliMUONTriggerEfficiencyCells * MakeTriggerEfficiency(const char *file="$ALICE_ROOT/MUON/data/efficiencyCells.dat")
void ReadFromFile(const char *filename)
Int_t GetBusPatchId(Int_t detElemId, Int_t manuId) const
Int_t GetManuSerial(Int_t detElemId, Int_t manuId) const
virtual TObject * FindObject(Int_t i, Int_t j) const
Find an object using 2 ids.
void WriteOccupancyMap(Bool_t defaultValues, Int_t startRun, Int_t endRun=AliCDBRunRange::Infinity())
Implementation of AliMUONVCalibParam for tuples of ints.
void WriteConfig(Int_t startRun, Int_t endRun=AliCDBRunRange::Infinity())
Int_t MakeRegionalTriggerConfigStore(AliMUONRegionalTriggerConfig &rtm)
Definition: AliMUONCDB.cxx:996
Int_t MakeHVStore(TMap &aliasMap, Bool_t defaultValues)
Definition: AliMUONCDB.cxx:496
AliMUONVStore * Diff(AliMUONVStore &store1, AliMUONVStore &store2, const char *opt="abs")
Definition: AliMUONCDB.cxx:352
Int_t MakeCapacitanceStore(AliMUONVStore &capaStore, Bool_t defaultValues)
Definition: AliMUONCDB.cxx:802
virtual Int_t ID0() const
First id of this object.
non-bending plane
Implementation of AliMUONVCalibParam for tuples of double.
void ReadIntegers(const char *filename, std::vector< int > &integers)
Definition: MUONStatusMap.C:60
void ShowConfig(Bool_t withStatusMap=kFALSE)
AliMpBusPatch * GetBusPatch(Int_t busPatchId, Bool_t warn=true) const
TObject * GetValue(Int_t keyFirst, Int_t keySecond) const
Definition: AliMpExMap.cxx:364
TH1 ** Plot(const AliMUONVStore &store, const char *name, Int_t nbins=512)
Definition: AliMUONCDB.cxx:421
Int_t GetId() const
Return the unique Id.
Definition: AliMpBusPatch.h:89
void WriteTracker(Bool_t defaultValues=kTRUE, Int_t startRun=0, Int_t endRun=AliCDBRunRange::Infinity())
Int_t DCSIndexFromDCSAlias(const char *dcsAlias) const
static Int_t TotalNofLocalBoards()
Return total number of trigger local boards.
Int_t MakeGlobalTriggerConfigStore(AliMUONGlobalCrateConfig &gtm)
Int_t MakeOccupancyMapStore(AliMUONVStore &occupancyMap, Bool_t defaultValues)
Definition: AliMUONCDB.cxx:740
void Add(Int_t keyFirst, Int_t keySecond, TObject *object)
Definition: AliMpExMap.cxx:291
Helper class for sorted integer array.
Definition: AliMpArrayI.h:21
Implementation of AliMUONVStore.
static Int_t SelfDeadMask()
Return status bit map to tell a pad is bad.
void WriteTrigger(Bool_t defaultValues=kTRUE, Int_t startRun=0, Int_t endRun=AliCDBRunRange::Infinity())
Int_t NofChannelsInManu(Int_t manuId) const
Bool_t CheckMapping(Bool_t segmentationOnly=kFALSE)
Definition: AliMUONCDB.cxx:211
Basic implementation of AliMUONVStore container using AliMpExMap internally.
Definition: AliMUON2DMap.h:20
void WriteRejectList(Bool_t defaultValues, Int_t startRun, Int_t endRun=AliCDBRunRange::Infinity())
Bool_t IsValid() const
Return validity.
Definition: AliMpPad.h:89
virtual Bool_t Add(TObject *object)=0
Add an object to the store.
The class defines the properties of BusPatch.
Definition: AliMpBusPatch.h:21
Single entry point to access MUON calibration data.
virtual Bool_t Add(TObject *object)
Add an object to the store.
static void UnloadAll()
Definition: AliMpCDB.cxx:508
Int_t DCSvariableFromDCSAlias(const char *dcsAlias) const
The abstract base class for the segmentation.
Implementation of AliMUONVStore.
Definition: AliMUON1DMap.h:21
Int_t GetBusPatchId(Int_t index) const
TArrayI runlist(10000)
static TString GlobalTriggerBoardMapping()
Definition: AliMpFiles.cxx:347
Object to hold the list of elements we want to reject from the reconstruction.
void WriteLocalTriggerMasks(Int_t startRun=0, Int_t endRun=AliCDBRunRange::Infinity())
void ReadIntegers(const char *filename, std::vector< int > &integers)
Class which encapsuate all information about a pad.
Definition: AliMpPad.h:22
Bool_t CheckOCDB(Bool_t pathOnly=kFALSE)
Definition: AliMUONCDB.cxx:187
Int_t HVStatus(Int_t detElemId, Int_t manuId) const
static TMap * CreateHV(Int_t runNumber, Int_t *startOfValidity=0, Bool_t patched=kTRUE, TList *messages=0x0, Bool_t dryRun=kFALSE)
Create a hv map (which must be deleted) from OCDB for the given run.
const AliMpArrayI * ManusForHV(Int_t hvIndex) const
Double_t MeanHVValueForDCSAlias(TMap &hvMap, const char *hvChannel)
UInt_t PadGoodnessMask() const
Get the goodness mask.
Int_t GetValue(Int_t index) const
Bool_t IsConnectedChannel(Int_t manuId, Int_t manuChannel) const
virtual AliMpPad PadByLocation(Int_t manuId, Int_t manuChannel, Bool_t warning=true) const =0
Find pad by location.
Int_t DetElemIdFromDCSAlias(const char *dcsAlias) const
Base class for MUON data stores.
Definition: AliMUONVStore.h:22
Bool_t LoadMapping(Bool_t segmentationOnly=kFALSE)
Definition: AliMUONCDB.cxx:257
void WriteCapacitances(Bool_t defaultValues, Int_t startRun=0, Int_t endRun=AliCDBRunRange::Infinity())
static Bool_t LoadAll(Bool_t warn=false)
Definition: AliMpCDB.cxx:196
void ShowCapacitances()
Int_t ReadData(const TString &fileName="")
virtual Int_t GetSize() const
The number of objects stored.
void WriteRegionalTriggerConfig(Int_t startRun=0, Int_t endRun=AliCDBRunRange::Infinity())
MUON trigger look up table class.
static Bool_t LoadMpSegmentation(Bool_t warn=false)
Definition: AliMpCDB.cxx:113
Int_t ReadData(const TString &fileName="")
static Int_t NofTrackingChambers()
Return number of tracking chambers.
The class defines the properties of regional trigger crate.
Make a 2DStore of pad statuses, using different sources of information.
void WriteToCDB(const char *calibpath, TObject *object, Int_t startRun, Int_t endRun, Bool_t defaultValues)
virtual TObject * FindObject(const char *name) const
Find an object by name.
Helper class making Root persistent TExMap.
Definition: AliMpExMap.h:28
static Int_t ManuMask(AliMp::PlaneType planeType)
AliMUONRecoParam * LoadRecoParam()
Definition: AliMUONCDB.cxx:290
virtual void SetValueAsDouble(Int_t i, Int_t j, Double_t value)
void SetLimits(const AliMUONRecoParam &recoParams)
virtual void Print(Option_t *opt="") const