File indexing completed on 2024-04-06 11:56:31
0001
0002
0003
0004
0005 #include "TTree.h"
0006 #include "TFriendElement.h"
0007
0008 #include "TFile.h"
0009 #include "TObjArray.h"
0010 #include "TH1.h"
0011 #include "TH2.h"
0012 #include "TProfile.h"
0013 #include "TGraph.h"
0014 #include "TError.h"
0015
0016 #include <iostream>
0017
0018 #include "MillePedeTrees.h"
0019
0020
0021
0022
0023
0024
0025
0026 MillePedeTrees::MillePedeTrees(const char *fileName, Int_t iter, const char *treeNameAdd)
0027 : fTree(NULL), fOrgPos("AlignablesOrgPos_0"),
0028 fMisPos("AlignablesAbsPos_0"), fMisPar("AlignmentParameters_0"),
0029 fPos(Form("AlignablesAbsPos_%d", iter)),
0030 fPar(Form("AlignmentParameters_%d", iter)), fMp(Form("MillePedeUser_%d", iter)),
0031 fUseSignedR(false), fBowsParameters(false), fSurfDefDeltaBows(true)
0032 {
0033 fTree = this->CreateTree(fileName, treeNameAdd);
0034 }
0035
0036
0037 MillePedeTrees::~MillePedeTrees()
0038 {
0039 delete fTree->GetCurrentFile();
0040 }
0041
0042
0043 TTree* MillePedeTrees::CreateTree(const char *fileName, const TString &treeNameAdd)
0044 {
0045 TFile *file = TFile::Open(fileName);
0046 if (!file) return NULL;
0047
0048 TString *allTreeNames[] = {&fOrgPos, &fPos, &fMisPos, &fMisPar, &fPar, &fMp};
0049 const unsigned int nTree = sizeof(allTreeNames) / sizeof(allTreeNames[0]);
0050
0051 unsigned int iTree = 0;
0052 TTree *mainTree = NULL;
0053 do {
0054 file->GetObject(allTreeNames[iTree]->Data(), mainTree);
0055 if (!mainTree) {
0056 ::Error("MillePedeTrees::CreateTree",
0057 "no tree %s in %s", allTreeNames[iTree]->Data(), fileName);
0058 }
0059 *(allTreeNames[iTree]) += treeNameAdd;
0060 if (mainTree && !treeNameAdd.IsNull()) {
0061 mainTree->SetName(*(allTreeNames[iTree]));
0062 }
0063 ++iTree;
0064 } while (!mainTree && iTree < nTree);
0065
0066 if (mainTree) {
0067 for (unsigned int jTree = iTree; jTree < nTree; ++jTree) {
0068 const TString newName(*(allTreeNames[jTree]) + treeNameAdd);
0069
0070
0071
0072
0073
0074
0075
0076
0077
0078
0079
0080 TFriendElement *fEle = mainTree->AddFriend(newName + " = " + *(allTreeNames[jTree]));
0081 if (!fEle || !fEle->GetTree()) {
0082 ::Error("MillePedeTrees::CreateTree","no %s as friend tree",allTreeNames[jTree]->Data());
0083 }
0084 *(allTreeNames[jTree]) = newName;
0085 }
0086 mainTree->SetEstimate(mainTree->GetEntries());
0087 }
0088
0089 return mainTree;
0090 }
0091
0092
0093 TH1* MillePedeTrees::Draw(const char* exp, const char* selection, const char *hDef, Option_t* opt)
0094 {
0095
0096 TString def(hDef);
0097 if (def.Length()) def.Prepend(">>");
0098
0099 fTree->Draw(exp + def, selection, opt);
0100
0101 return fTree->GetHistogram();
0102
0103
0104
0105
0106 }
0107
0108
0109 TH1 *MillePedeTrees::CreateHist(const char *exp, const char *selection, const char *hDef,
0110 Option_t* opt)
0111 {
0112 TH1 *h = this->Draw(exp, selection, hDef, "goff");
0113
0114 TH1 *hResult = static_cast<TH1*>(h->Clone(Form("%sC", h->GetName())));
0115 if (opt) hResult->SetOption(opt);
0116
0117 return hResult;
0118 }
0119
0120
0121
0122 TProfile *MillePedeTrees::CreateHistProf(const char *expX, const char *expY, const char *selection,
0123 const char *hDef, Option_t* opt)
0124 {
0125
0126 const TString combExpr(Form("%s:%s", expY, expX));
0127 TH1 *h = this->Draw(combExpr, selection, hDef, "goff prof");
0128
0129 TProfile *hResult = static_cast<TProfile*>(h->Clone(Form("%sClone", h->GetName())));
0130 if (opt) hResult->SetOption(opt);
0131
0132 return hResult;
0133 }
0134
0135
0136 TH2 *MillePedeTrees::CreateHist2D(const char *expX, const char *expY, const char *selection,
0137 const char *hDef, Option_t* opt)
0138 {
0139 const TString combExpr(Form("%s:%s", expY, expX));
0140 TH1 *h = this->CreateHist(combExpr, selection, hDef, opt);
0141
0142 return static_cast<TH2*>(h);
0143 }
0144
0145
0146 TGraph *MillePedeTrees::CreateGraph(const char *expX, const char *expY, const char *sel, Option_t *)
0147 {
0148 TH2 *h = this->CreateHist2D(expX, expY, sel, NULL, "goff");
0149 if (!h) return NULL;
0150
0151 ::Error("MillePedeTrees::CreateGraph", "Not yet implemented.");
0152
0153 return NULL;
0154 }
0155
0156
0157
0158
0159
0160
0161
0162
0163
0164
0165
0166
0167
0168
0169 TString MillePedeTrees::RPos2(const TString &tree) const
0170 {
0171
0172 const TString x(tree + XPos());
0173 const TString y(tree + YPos());
0174
0175 return Parenth((x + Mal() += x) + Plu() += (y + Mal() += y));
0176 }
0177
0178
0179 TString MillePedeTrees::RPos(const TString &tree) const
0180 {
0181 const TString r(Sqrt(RPos2(tree)));
0182
0183 if (fUseSignedR) {
0184 const TString y(tree + Pos(2));
0185 return r + Mal() += Parenth(Fun("TMath::Abs", y) += Div() += y);
0186 } else {
0187 return r;
0188 }
0189
0190 }
0191
0192
0193 TString MillePedeTrees::Phi(const TString &tree) const
0194 {
0195 return Fun("TMath::ATan2", tree + YPos() += "," + tree + XPos());
0196 }
0197
0198
0199 TString MillePedeTrees::OrgPos(const TString &pos) const
0200 {
0201
0202 const TString tree(OrgPosT());
0203 if (pos == "x") {
0204 return tree + Pos(0);
0205 } else if (pos == "y") {
0206 return tree + Pos(1);
0207 } else if (pos == "z") {
0208 return tree + Pos(2);
0209 } else if (pos == "r") {
0210 return RPos(tree);
0211 } else if (pos == "phi") {
0212 return Phi(tree);
0213 } else {
0214 ::Error("MillePedeTrees::OrgPos", "unknown position %s, try x,y,z,r,phi", pos.Data());
0215 return "";
0216 }
0217 }
0218
0219
0220 TString MillePedeTrees::PhiSwaps(double swapAround, const TString &tree1, const TString &tree2) const
0221 {
0222
0223 return
0224 Parenth((Phi(tree1) += Form(">%f", swapAround)) +=
0225 AndL() += Phi(tree2) += Form("<%f", swapAround))
0226 += OrL()
0227 += Parenth((Phi(tree1) += Form("<%f", swapAround)) +=
0228 AndL() += Phi(tree2) += Form(">%f", swapAround));
0229 }
0230
0231
0232 TString MillePedeTrees::Theta(const TString &tree) const
0233 {
0234
0235
0236 return Fun("TMath::ATan2", Sqrt(RPos2(tree)) += "," + tree + ZPos())
0237 += "*(" + XPos() += "!=0.&&" + YPos() += "!=0.&&" + ZPos() += "!=0.)";
0238 }
0239
0240
0241 TString MillePedeTrees::Alpha(const TString &tree, bool betaMpiPpi) const
0242 {
0243
0244
0245
0246
0247
0248
0249
0250
0251
0252
0253
0254
0255
0256 TString euler1("TMath::ASin(Rot[6])");
0257 if (!betaMpiPpi) euler1.Prepend("TMath::Pi() - ");
0258
0259 TString euler0("TMath::ATan(-Rot[7]/Rot[8]) + (TMath::Pi() * (TMath::Cos(");
0260 euler0 += euler1;
0261 euler0 += ") * Rot[8] <= 0))";
0262
0263 TString result(Form("(TMath::Abs(Rot[6] - 1.0) >= 1.e-6) * (%s)", euler0.Data()));
0264 result.ReplaceAll("Rot[", tree + "Rot[");
0265
0266 return result;
0267
0268
0269
0270
0271
0272
0273
0274
0275
0276
0277
0278
0279
0280
0281
0282
0283
0284
0285
0286
0287
0288
0289
0290
0291 }
0292
0293
0294 TString MillePedeTrees::Beta(const TString &tree, bool betaMpiPpi) const
0295 {
0296 TString euler1("TMath::ASin(Rot[6])");
0297 if (!betaMpiPpi) euler1.Prepend("TMath::Pi() - ");
0298
0299 TString result(Form("(TMath::Abs(Rot[6] - 1.0) >= 1.e-6) * (%s)", euler1.Data()));
0300 result += " + (TMath::Abs(Rot[6] - 1.0) < 1.e-6) * TMath::PiOver2()";
0301
0302 result.ReplaceAll("Rot[", tree + "Rot[");
0303 return result;
0304
0305
0306
0307
0308
0309
0310
0311
0312
0313
0314
0315
0316
0317
0318
0319
0320
0321
0322
0323
0324
0325
0326
0327
0328
0329
0330 }
0331
0332
0333 TString MillePedeTrees::Gamma(const TString &tree, bool betaMpiPpi) const
0334 {
0335 TString euler1("TMath::ASin(Rot[6])");
0336 if (!betaMpiPpi) euler1.Prepend("TMath::Pi() - ");
0337
0338 TString euler2("TMath::ATan(-Rot[3]/Rot[0]) + (TMath::Pi() * (TMath::Cos(");
0339 euler2 += euler1;
0340 euler2 += ") * Rot[0] <= 0))";
0341
0342 TString result(Form("(TMath::Abs(Rot[6] - 1.0) >= 1.e-6) * (%s)", euler2.Data()));
0343 result += "+ (TMath::Abs(Rot[6] - 1.0) < 1.e-6) * (TMath::ATan(Rot[5]/Rot[4]))";
0344 result.ReplaceAll("Rot[", tree + "Rot[");
0345
0346 return result;
0347
0348
0349
0350
0351
0352
0353
0354
0355
0356
0357
0358
0359
0360
0361
0362
0363
0364
0365
0366
0367
0368
0369
0370
0371
0372
0373 }
0374
0375
0376 TString MillePedeTrees::ParSi(const TString &tree, UInt_t iParam) const
0377 {
0378 TString index(Form("%sparSize*%d", tree.Data(), iParam));
0379 if (iParam > 1) {
0380 UInt_t aParNum = 1;
0381 UInt_t reducer = 0;
0382 while (aParNum < iParam) {
0383 reducer += aParNum;
0384 ++aParNum;
0385 }
0386 index += Form("-%d", reducer);
0387 }
0388
0389 return Sqrt((tree + "Cov") += Bracket(index));
0390 }
0391
0392
0393 TString MillePedeTrees::DelPos(UInt_t ui, const TString &tree1, const TString &tree2) const
0394 {
0395 return tree1 + Pos(ui) += (Min() += tree2) += Pos(ui);
0396 }
0397
0398
0399 TString MillePedeTrees::DelR(const TString &tree1, const TString &tree2) const
0400 {
0401 return RPos(tree1) += Min() += RPos(tree2);
0402 }
0403
0404
0405 TString MillePedeTrees::DelRphi(const TString &tree1, const TString &tree2) const
0406 {
0407
0408
0409 const TString deltaX = Parenth(tree1 + XPos() += (Min() += tree2) += XPos());
0410 const TString deltaY = Parenth(tree1 + YPos() += (Min() += tree2) += YPos());
0411
0412
0413 return Parenth(Parenth(deltaX + Mal() += ("-" + tree2) += YPos()
0414 += Plu() += deltaY + Mal() += tree2 + XPos()
0415 ) += Div() += Sqrt(RPos2(tree2))
0416 );
0417 }
0418
0419
0420
0421
0422
0423
0424
0425
0426
0427
0428
0429
0430
0431
0432
0433
0434
0435 TString MillePedeTrees::DelPhi(const TString &tree1, const TString &tree2) const
0436 {
0437 return Fun("TVector2::Phi_mpi_pi", Phi(tree1) += Min() += Phi(tree2));
0438 }
0439
0440
0441 TString MillePedeTrees::Valid(UInt_t iParam) const
0442 {
0443 return (MpT() += "IsValid") += Bracket(iParam);
0444 }
0445
0446
0447 TString MillePedeTrees::Fixed(UInt_t iParam, bool isFixed) const
0448 {
0449 return (isFixed ? Parenth(PreSi(iParam) += "<0.") : "!" + Parenth(PreSi(iParam) += "<0."));
0450 }
0451
0452
0453 TString MillePedeTrees::AnyFreePar() const
0454 {
0455 TString result("(");
0456 for (UInt_t iPar = 0; iPar < kNpar; ++iPar) {
0457 result += Fixed(iPar, false);
0458 if (iPar != kNpar - 1) result += OrL();
0459 else result += ")";
0460 }
0461
0462 return result;
0463 }
0464
0465
0466 TString MillePedeTrees::Label(UInt_t iParam) const
0467 {
0468
0469 return Parenth((MpT() += "Label + ") += Int(iParam));
0470 }
0471
0472
0473
0474 TString MillePedeTrees::Cor(UInt_t iParam) const
0475 {
0476 return (MpT() += "GlobalCor") += Bracket(iParam);
0477 }
0478
0479
0480 TString MillePedeTrees::Diff(UInt_t iParam) const
0481 {
0482 return (MpT() += "DiffBefore") += Bracket(iParam);
0483 }
0484
0485
0486 TString MillePedeTrees::PreSi(UInt_t iParam) const
0487 {
0488 return (MpT() += "PreSigma") += Bracket(iParam);
0489 }
0490
0491
0492 TString MillePedeTrees::ParSi(UInt_t iParam) const
0493 {
0494 return (MpT() += "Sigma") += Bracket(iParam);
0495 }
0496
0497
0498 TString MillePedeTrees::ParSiOk(UInt_t iParam) const
0499 {
0500
0501 return Parenth(ParSi(iParam) += " != -1.");
0502 }
0503
0504
0505 TString MillePedeTrees::DeformValue(UInt_t i, const TString &whichOne) const
0506 {
0507 const unsigned int iDelta = 9;
0508
0509 if (whichOne == "diff") {
0510
0511 TString result((PosT() += Form("DeformValues[%u]", i)) += Min()
0512 += MisPosT() += Form("DeformValues[%u]", i));
0513 if (!fSurfDefDeltaBows) {
0514 if(i <= 2) {
0515 result += Plu() += PosT() += Form("DeformValues[%u]", i + iDelta)
0516 + Min() += MisPosT() += Form("DeformValues[%u]", i + iDelta);
0517 } else if (i >= 9 && i <=11) {
0518 result = Min() += Parenth(result);
0519
0520 result += Plu() += PosT() += Form("DeformValues[%u]", i - iDelta)
0521 + Min() += MisPosT() += Form("DeformValues[%u]", i - iDelta);
0522 }
0523 }
0524 return Parenth(result);
0525 } else {
0526
0527 TString tree;
0528 if (whichOne == "result") tree = PosT();
0529 else if (whichOne == "start") tree = MisPosT();
0530 else {
0531 ::Error("MillePedeTrees::DeformValue",
0532 "unknown 'whichOne': %s", whichOne.Data());
0533 return "1";
0534 }
0535
0536 if (!fSurfDefDeltaBows) {
0537 if(i <= 2) {
0538 return Parenth(tree + Form("DeformValues[%u]", i) += Plu()
0539 += tree + Form("DeformValues[%u]", i + iDelta));
0540 } else if (i >= 9 && i <= 11) {
0541 return Parenth(tree + Form("DeformValues[%u]", i - iDelta) += Min()
0542 += tree + Form("DeformValues[%u]", i));
0543 }
0544 }
0545 return tree += Form("DeformValues[%u]", i);
0546 }
0547 }
0548
0549
0550 TString MillePedeTrees::NumDeformValues(const TString &whichOne) const
0551 {
0552
0553 if (whichOne == "diff") {
0554 return Fun("TMath::Min", (PosT() += "NumDeform,") += MisPosT() += "NumDeform");
0555 } else {
0556 TString tree;
0557 if (whichOne == "result") tree = PosT();
0558 else if (whichOne == "start") tree = MisPosT();
0559 else {
0560 ::Error("MillePedeTrees::NumDeformValues",
0561 "unknown 'whichOne': %s", whichOne.Data());
0562 return "0";
0563 }
0564 return tree += "NumDeform";
0565 }
0566 }
0567
0568
0569 TString MillePedeTrees::Name(UInt_t iParam) const
0570 {
0571 switch (iParam) {
0572 case 0: return "u";
0573 case 1: return "v";
0574 case 2: return "w";
0575 case 3: return "#alpha";
0576 case 4: return "#beta";
0577 case 5: return "#gamma";
0578 default:
0579
0580 return Form("param%d", iParam);
0581 }
0582 }
0583
0584
0585 TString MillePedeTrees::NamePede(UInt_t iParam) const
0586 {
0587 if (fBowsParameters) {
0588 switch (iParam) {
0589
0590
0591
0592
0593
0594
0595
0596
0597
0598
0599
0600
0601 case 0: return "u^{1}";
0602 case 1: return "v^{1}";
0603 case 2: return "w_{00}^{1}";
0604 case 3: return "w_{10}^{1}";
0605 case 4: return "w_{01}^{1}";
0606 case 5: return "#gamma'^{1}";
0607 case 6: return "w_{20}^{1}";
0608 case 7: return "w_{11}^{1}";
0609 case 8: return "w_{02}^{1}";
0610 case 9: return "u^{2}";
0611 case 10: return "v^{2}";
0612 case 11: return "w_{00}^{2}";
0613 case 12: return "w_{10}^{2}";
0614 case 13: return "w_{01}^{2}";
0615 case 14: return "#gamma'^{2}";
0616 case 15: return "w_{20}^{2}";
0617 case 16: return "w_{11}^{2}";
0618 case 17: return "w_{02}^{2}";
0619
0620
0621
0622
0623
0624
0625
0626
0627
0628
0629
0630
0631
0632
0633
0634
0635
0636
0637
0638
0639
0640
0641
0642
0643
0644 default:
0645 ::Error("MillePedeTrees::Name", "unknown parameter %d", iParam);
0646 return Form("param%d", iParam);
0647 }
0648 } else {
0649 return this->Name(iParam);
0650 }
0651 }
0652
0653
0654 TString MillePedeTrees::NameSurfDef(UInt_t iParam) const
0655 {
0656 if (!fSurfDefDeltaBows) {
0657 switch(iParam) {
0658 case 0: return "w_{20}^{1}";
0659 case 1: return "w_{11}^{1}";
0660 case 2: return "w_{02}^{1}";
0661
0662 case 9: return "w_{20}^{2}";
0663 case 10: return "w_{11}^{2}";
0664 case 11: return "w_{02}^{2}";
0665
0666 default:
0667 ;
0668 }
0669 }
0670
0671 switch(iParam) {
0672 case 0: return "w_{20}";
0673 case 1: return "w_{11}";
0674 case 2: return "w_{02}";
0675 case 3: return "u^{#delta}";
0676 case 4: return "v^{#delta}";
0677 case 5: return "w^{#delta}";
0678 case 6: return "#alpha^{#delta}";
0679 case 7: return "#beta^{#delta}";
0680 case 8: return "#gamma^{#delta}";
0681 case 9: return "w_{20}^{#delta}";
0682 case 10:return "w_{11}^{#delta}";
0683 case 11:return "w_{02}^{#delta}";
0684 case 12:return "y_{split}";
0685 default:
0686 ::Error("MillePedeTrees::NameSurfDef", "unknown parameter %d", iParam);
0687 return Form("surfDefParam %u", iParam);
0688 }
0689
0690 }
0691
0692
0693 TString MillePedeTrees::UnitPede(UInt_t iParam) const
0694 {
0695 if (fBowsParameters) {
0696 switch(iParam) {
0697 case 0:
0698 case 1:
0699 case 2:
0700 case 9:
0701 case 10:
0702 case 11:
0703
0704
0705
0706
0707 case 5:
0708 case 14:
0709 case 3:
0710 case 4:
0711 case 6:
0712 case 7:
0713 case 8:
0714 case 12:
0715 case 13:
0716 case 15:
0717 case 16:
0718 case 17:
0719 return " [#mum]";
0720
0721 default:
0722 ::Error("MillePedeTrees::UnitPede", "unknown parameter %d", iParam);
0723 return " [?]";
0724 }
0725 } else {
0726 return this->Unit(iParam);
0727 }
0728 }
0729
0730
0731 TString MillePedeTrees::UnitSurfDef(UInt_t iParam) const
0732 {
0733 switch(iParam) {
0734 case 0:
0735 case 1:
0736 case 2:
0737 case 3:
0738 case 4:
0739 case 5:
0740 case 9:
0741 case 10:
0742 case 11:
0743 case 12:
0744 return " [#mum]";
0745 case 6:
0746 case 7:
0747 case 8:
0748 return " [#murad]";
0749 default:
0750 ::Error("MillePedeTrees::UnitSurfDef", "unknown parameter %d", iParam);
0751 return " [?]";
0752 }
0753 }
0754
0755
0756 TString MillePedeTrees::ToMumMuRadPede(UInt_t iParam) const
0757 {
0758 if (fBowsParameters) {
0759 switch(iParam) {
0760 case 0:
0761 case 1:
0762 case 2:
0763 case 9:
0764 case 10:
0765 case 11:
0766
0767
0768
0769
0770 case 5:
0771 case 14:
0772 case 3:
0773 case 4:
0774 case 6:
0775 case 7:
0776 case 8:
0777 case 12:
0778 case 13:
0779 case 15:
0780 case 16:
0781 case 17:
0782 return "*10000";
0783
0784 default:
0785 ::Error("MillePedeTrees::ToMumMuRadPede", "unknown parameter %d", iParam);
0786 return "";
0787 }
0788 } else {
0789 return this->ToMumMuRad(iParam);
0790 }
0791 }
0792
0793
0794 TString MillePedeTrees::ToMumMuRadSurfDef(UInt_t iParam) const
0795 {
0796 switch(iParam) {
0797 case 0:
0798 case 1:
0799 case 2:
0800 case 3:
0801 case 4:
0802 case 5:
0803 case 9:
0804 case 10:
0805 case 11:
0806 case 12:
0807 return "*10000";
0808 case 6:
0809 case 7:
0810 case 8:
0811 return "*1000000";
0812 default:
0813 ::Error("MillePedeTrees::ToMumMuRadSurfDef", "unknown parameter %d", iParam);
0814 return "";
0815 }
0816 }
0817
0818
0819 TString MillePedeTrees::ToMumMuRad(const TString &pos) const
0820 {
0821 if (pos == "r" || pos == "rphi" || pos == "x" || pos == "y" || pos == "z") {
0822 return "*10000";
0823 } else if (pos == "phi") {
0824 return "*1000000";
0825 } else {
0826 ::Error("MillePedeTrees::ToMumMuRad", "unknown position %s", pos.Data());
0827 return "";
0828 }
0829 }
0830
0831
0832 TString MillePedeTrees::Name(const TString &pos) const
0833 {
0834 if (pos == "r" || pos == "x" || pos == "y" || pos == "z") {
0835 return pos;
0836 } else if (pos == "phi") {
0837 return "#phi";
0838 } else if (pos == "rphi") {
0839 return "r#phi";
0840 } else {
0841 ::Error("MillePedeTrees::Name", "unknown position %s", pos.Data());
0842 return "";
0843 }
0844 }
0845
0846
0847
0848 TString MillePedeTrees::NamePos(UInt_t iPos) const
0849 {
0850 switch (iPos) {
0851 case 0: return "x";
0852 case 1: return "y";
0853 case 2: return "z";
0854 }
0855
0856 ::Error("MillePedeTrees::NamePos", "unknown position %d", iPos);
0857 return "";
0858 }
0859
0860
0861 TString MillePedeTrees::DelName(const TString &pos) const
0862 {
0863 if (pos == "rphi") {
0864 return "r#Delta#phi";
0865 } else {
0866 return "#Delta"+Name(pos);
0867 }
0868 }
0869
0870
0871 TString MillePedeTrees::Unit(const TString &pos) const
0872 {
0873 if (pos == "r" || pos == "rphi" || pos == "x" || pos == "y" || pos == "z") {
0874 return " [#mum]";
0875 } else if (pos == "phi") {
0876 return " [#murad]";
0877 } else {
0878 ::Error("MillePedeTrees::Unit", "unknown position %s", pos.Data());
0879 return "";
0880 }
0881 }
0882
0883
0884 TString MillePedeTrees::DeltaPos(const TString &pos, const TString &tree) const
0885 {
0886 if (pos == "r") {
0887 return DelR(tree);
0888 } else if(pos == "rphi") {
0889 return DelRphi(tree);
0890 } else if(pos == "x") {
0891 return DelPos(0, tree);
0892 } else if(pos == "y") {
0893 return DelPos(1, tree);
0894 } else if(pos == "z") {
0895 return DelPos(2, tree);
0896 } else if (pos == "phi") {
0897 return DelPhi(tree);
0898 } else {
0899 ::Error("MillePedeTrees::Delta", "unknown position %s", pos.Data());
0900 return "";
0901 }
0902 }
0903
0904
0905 TString MillePedeTrees::SelIs1D() const
0906 {
0907 return Parenth("!" + SelIs2D());
0908 }
0909
0910
0911 TString MillePedeTrees::SelIs2D() const
0912 {
0913
0914
0915 const TString r(Sqrt(RPos2(OrgPosT())));
0916
0917 return Parenth((r + "<40 || (") += (r + ">57.5 && ") += (r + "<75)"));
0918 }
0919
0920
0921
0922
0923
0924
0925
0926
0927
0928
0929
0930
0931
0932
0933
0934
0935
0936
0937