#include <iostream>
#include <string>
#include "MuonDetDescrUtils/MuonSectorMapping.h"
#include "TFile.h"
#include "TTree.h"
Go to the source code of this file.
|
int | main (int argc, char *argv[]) |
|
◆ main()
int main |
( |
int |
argc, |
|
|
char * |
argv[] |
|
) |
| |
Definition at line 12 of file MuonSectorMappingTest.cxx.
13 if (
argc > 1) { std::cout <<
argv[0] << std::endl; }
16 TFile*
output =
new TFile(
"MuonSectorMapping.root",
"RECREATE");
17 TTree*
tree =
new TTree(
"sm",
"sm");
33 tree->Branch(
"phi", &
phi,
"phi/F");
35 tree->Branch(
"phiInSector", &phiInSector,
"phiInSector/F");
36 tree->Branch(
"phiTest", &phiTest,
"phiTest/F");
37 tree->Branch(
"rInSector", &rInSector,
"rInSector/F");
38 tree->Branch(
"rTest", &rTest,
"rTest/F");
39 tree->Branch(
"phiSector", &phiSector,
"phiSector/F");
40 tree->Branch(
"neighbourPhi", &neighbourPhi,
"neighbourPhi/F");
41 tree->Branch(
"rNeighbour", &rNeighbour,
"rNeighbour/F");
42 tree->Branch(
"overlapPhi", &overlapPhi,
"overlapPhi/F");
43 tree->Branch(
"id", &
id,
"id/I");
44 tree->Branch(
"closeToEdge", &closeToEdge,
"closeToEdge/I");
45 tree->Branch(
"neighbours", &neighbours,
"neighbours/I");
46 tree->Branch(
"neighbourId", &neighbourId,
"neighbourId/I");
50 unsigned int nsamplings = 100000;
51 float dphi = 2 *
M_PI / nsamplings;
52 for (
unsigned int i = 0;
i < nsamplings; ++
i) {
61 std::vector<int> sectors;
63 neighbours = sectors.size();
65 for (
auto val : sectors) {
66 if (
val !=
id) neighbourId =
val;
71 if (neighbourId > 0) {
72 neighbourPhi = sectorMapping.
sectorPhi(neighbourId);
double transformRToSector(double r, double phi, int sector, bool toSector=true) const
expresses a radial position from and to the sector coordinate frame, the phi position should always b...