23void hist102_TH2_contour_list()
29 c->SetRightMargin(0.15);
30 c->SetTopMargin(0.15);
35 Int_t nPhiSamples = 80;
47 for (i = 0; i < nZsamples; i++) {
48 z[i] = (i)*dZ - HofZwavelength / 2.0;
49 HofZ[i] = SawTooth(z[i], HofZwavelength);
52 for (
Int_t i = 0; i < nPhiSamples; i++) {
54 FofPhi[i] =
sin(phi[i]);
60 "#splitline{Histogram with negative and positive contents. Six contours are defined.}{It is plotted "
61 "with options CONT LIST to retrieve the contours points in TGraphs}",
62 nZsamples, z[0], z[nZsamples - 1], nPhiSamples, phi[0], phi[nPhiSamples - 1]);
65 for (
Int_t i = 0; i < nZsamples; i++) {
66 for (
Int_t j = 0; j < nPhiSamples; j++) {
86 HistStreamFn->
Draw(
"CONT Z LIST");
93 printf(
"*** No Contours Were Extracted!\n");
97 TList *contLevel =
nullptr;
104 printf(
"TotalConts = %d\n", TotalConts);
106 for (i = 0; i < TotalConts; i++) {
107 contLevel = (
TList *)conts->
At(i);
108 printf(
"Contour %d has %d Graphs\n", i, contLevel->
GetSize());
109 nGraphs += contLevel->
GetSize();
115 c1->SetTopMargin(0.15);
118 "#splitline{Negative contours are returned first (highest to lowest). Positive contours are returned "
119 "from}{lowest to highest. On this plot Negative contours are drawn in red and positive contours in blue.}",
120 2, -2, 2, 2, 0, 6.5);
128 for (i = 0; i < TotalConts; i++) {
129 contLevel = (
TList *)conts->
At(i);
131 zval0 = contours[2 - i];
134 printf(
"Z-Level Passed in as: Z = %f\n", zval0);
138 for (j = 0; j < contLevel->
GetSize(); j++) {
145 printf(
"\tGraph: %d -- %d Elements\n", nGraphs, curv->
GetN());
152 l.DrawLatex(xval0, yval0,
Form(
"%g", zval0));
157 printf(
"\n\n\tExtracted %d Contours and %d Graphs \n", TotalConts, nGraphs);
182 if ((
x < -WaveLen / 2) || (
x > WaveLen / 2))
184 if (
x <= -WaveLen / 4) {
186 }
else if ((
x > -WaveLen / 4) && (
x <= WaveLen / 4)) {
188 }
else if ((
x > WaveLen / 4) && (
x <= WaveLen / 2)) {
int Int_t
Signed integer 4 bytes (int).
double Double_t
Double 8 bytes.
char * Form(const char *fmt,...)
Formats a string in a circular formatting buffer.
Array of doubles (64 bits per element).
virtual void SetLineColor(Color_t lcolor)
Set the line color.
virtual Int_t GetSize() const
Return the capacity of the collection, i.e.
void Draw(Option_t *chopt="") override
Default Draw method for all objects.
virtual Int_t GetPoint(Int_t i, Double_t &x, Double_t &y) const
void Draw(Option_t *option="") override
Draw this histogram with options.
virtual void SetContour(Int_t nlevels, const Double_t *levels=nullptr)
Set the number and values of contour levels.
2-D histogram with a double per channel (see TH1 documentation)
2-D histogram with a float per channel (see TH1 documentation)
void SetBinContent(Int_t bin, Double_t content) override
Set bin content.
TObject * After(const TObject *obj) const override
Returns the object after object obj.
TObject * First() const override
Return the first object in the list. Returns 0 when list is empty.
TObject * Clone(const char *newname="") const override
Make a clone of an object using the Streamer facility.
TObject * At(Int_t idx) const override
RVec< PromoteType< T > > sin(const RVec< T > &v)